-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Hello! Thank you for this library. We'd love to start using it but we'd prefer not to introduce a dependency on zod in our monorepo for a couple of reasons:
- Zod interacts poorly with TypeScript isolated declarations
- We have our own internal schema validation libraries that we'd like to be able to use instead. We write all of our code in a (very?) large monorepo so we try hard to add as few top-level dependencies as possible.
- We'd like to be able to share code between MCP tools and other parts of the codebase (which are using the internal library rather than zod).
Describe the solution you'd like
Allow users of this library to pass in their own schema validation functions rather than requiring {input,output}Schema
parameters, e.g. the addition tool would become
function parseInput(o: any): { a: number, b: number } { ... }
function parseOutput(o: any): { output: number } { ... }
server.registerTool(
'add',
{
title: 'Addition Tool',
description: 'Add two numbers',
parseInput,
parseOutput
},
async ({ a, b }) => {
const output = { result: a + b };
return {
content: [{ type: 'text', text: JSON.stringify(output) }],
structuredContent: output
};
}
);
These parameters would be in addition to the {input,output}Schema
, rather than replacing them.
Describe alternatives you've considered
N/A
Additional context
N/A
JulianCataldo
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request