I used an LLM to vibe code my first MCP Framework, and the LLM defined the schema like so:
schema = {
repository: z.string().describe("Repository name, e.g., 'lockup'"),
};
Then, I was getting this bug when running the MCP server: #120
The LLM was unable to figure out why it was not working.
The issue was that I had defined the schema like so:
schema = {
repository: z.string().describe("Repository name, e.g., 'lockup'"),
};
When I should have defined it like so:
schema = {
repository: {
description: "Repository name, e.g., 'lockup'",
type: z.string(),
},
};
This is something that can be caught at compile time. A bespoke error can be thrown.