From 546a4e01737f202f5760f75b014031348447e3e0 Mon Sep 17 00:00:00 2001 From: Stevie Clifton Date: Sat, 14 Jun 2025 08:55:31 -0700 Subject: [PATCH] Fix zod typing for variables definition The query variables zod definition currently tells the LLM that it expects a string, which the LLM interprets as needing to be a JSON string. This will cause requests to fail, and then the LLM needs to figure out how to fix, which it does some of the time. By properly changing this to a zod record object, it allows the LLM to format the variables correctly the first time. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index d48a121..3e61f10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -111,7 +111,7 @@ server.tool( "Query a GraphQL endpoint with the given query and variables", { query: z.string(), - variables: z.string().optional(), + variables: z.record(z.any()).optional(), }, async ({ query, variables }) => { try {