From 16534adc67996d29d5f551ea7a881c548ef3f07d Mon Sep 17 00:00:00 2001 From: Radesh Govind Date: Fri, 27 Mar 2026 12:32:17 +0000 Subject: [PATCH 1/2] fix(schema): add missing property descriptions across official MCP servers --- src/everything/tools/get-resource-links.ts | 1 - .../tools/get-resource-reference.ts | 3 +- src/everything/tools/gzip-file-as-resource.ts | 7 ++-- .../tools/trigger-long-running-operation.ts | 3 +- src/filesystem/index.ts | 34 +++++++++---------- src/memory/index.ts | 8 ++--- 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/everything/tools/get-resource-links.ts b/src/everything/tools/get-resource-links.ts index b1fc627e20..976a2f0a5e 100644 --- a/src/everything/tools/get-resource-links.ts +++ b/src/everything/tools/get-resource-links.ts @@ -14,7 +14,6 @@ const GetResourceLinksSchema = z.object({ .number() .min(1) .max(10) - .default(3) .describe("Number of resource links to return (1-10)"), }); diff --git a/src/everything/tools/get-resource-reference.ts b/src/everything/tools/get-resource-reference.ts index d3dc5d3ecb..be7f8c63c3 100644 --- a/src/everything/tools/get-resource-reference.ts +++ b/src/everything/tools/get-resource-reference.ts @@ -15,10 +15,9 @@ import { const GetResourceReferenceSchema = z.object({ resourceType: z .enum([RESOURCE_TYPE_TEXT, RESOURCE_TYPE_BLOB]) - .default(RESOURCE_TYPE_TEXT), + .describe(`Type of resource to fetch. Use '${RESOURCE_TYPE_TEXT}' for plain text resources or '${RESOURCE_TYPE_BLOB}' for binary blob resources.`), resourceId: z .number() - .default(1) .describe("ID of the text resource to fetch"), }); diff --git a/src/everything/tools/gzip-file-as-resource.ts b/src/everything/tools/gzip-file-as-resource.ts index 608fcf4a0d..8c67876670 100644 --- a/src/everything/tools/gzip-file-as-resource.ts +++ b/src/everything/tools/gzip-file-as-resource.ts @@ -29,10 +29,7 @@ const GZipFileAsResourceSchema = z.object({ data: z .string() .url() - .describe("URL or data URI of the file content to compress") - .default( - "https://raw.githubusercontent.com/modelcontextprotocol/servers/refs/heads/main/README.md" - ), + .describe("URL or data URI of the file content to compress"), outputType: z .enum(["resourceLink", "resource"]) .default("resourceLink") @@ -90,7 +87,7 @@ export const registerGZipFileAsResourceTool = (server: McpServer) => { const uri = getSessionResourceURI(name); const blob = compressedBuffer.toString("base64"); const mimeType = "application/gzip"; - const resource = { uri, name, mimeType }; + const resource = { uri, name, mimeType, description: `Gzip-compressed version of '${name}', available for reading during the current session.` }; // Register resource, get resource link in return const resourceLink = registerSessionResource( diff --git a/src/everything/tools/trigger-long-running-operation.ts b/src/everything/tools/trigger-long-running-operation.ts index 8af45ce60b..abb280d539 100644 --- a/src/everything/tools/trigger-long-running-operation.ts +++ b/src/everything/tools/trigger-long-running-operation.ts @@ -6,9 +6,8 @@ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; const TriggerLongRunningOperationSchema = z.object({ duration: z .number() - .default(10) .describe("Duration of the operation in seconds"), - steps: z.number().default(5).describe("Number of steps in the operation"), + steps: z.number().describe("Number of steps in the operation"), }); // Tool configuration diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 7b67e63e58..ddc1e6e4ed 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -94,7 +94,7 @@ setAllowedDirectories(allowedDirectories); // Schema definitions const ReadTextFileArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute or relative path to the text file to read. Must be within allowed directories.'), tail: z.number().optional().describe('If provided, returns only the last N lines of the file'), head: z.number().optional().describe('If provided, returns only the first N lines of the file') }); @@ -235,7 +235,7 @@ server.registerTool( "the last N lines of a file. Operates on the file as text regardless of extension. " + "Only works within allowed directories.", inputSchema: { - path: z.string(), + path: z.string().describe("Absolute or relative path to the text file to read. Must be within allowed directories."), tail: z.number().optional().describe("If provided, returns only the last N lines of the file"), head: z.number().optional().describe("If provided, returns only the first N lines of the file") }, @@ -253,7 +253,7 @@ server.registerTool( "Read an image or audio file. Returns the base64 encoded data and MIME type. " + "Only works within allowed directories.", inputSchema: { - path: z.string() + path: z.string().describe("Absolute or relative path to the image or audio file to read. Must be within allowed directories.") }, outputSchema: { content: z.array(z.object({ @@ -345,8 +345,8 @@ server.registerTool( "Use with caution as it will overwrite existing files without warning. " + "Handles text content with proper encoding. Only works within allowed directories.", inputSchema: { - path: z.string(), - content: z.string() + path: z.string().describe("Absolute or relative path to the file to create or overwrite. Must be within allowed directories."), + content: z.string().describe("Full text content to write to the file.") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: true } @@ -371,7 +371,7 @@ server.registerTool( "with new content. Returns a git-style diff showing the changes made. " + "Only works within allowed directories.", inputSchema: { - path: z.string(), + path: z.string().describe("Absolute or relative path to the text file to edit. Must be within allowed directories."), edits: z.array(z.object({ oldText: z.string().describe("Text to search for - must match exactly"), newText: z.string().describe("Text to replace with") @@ -401,7 +401,7 @@ server.registerTool( "this operation will succeed silently. Perfect for setting up directory " + "structures for projects or ensuring required paths exist. Only works within allowed directories.", inputSchema: { - path: z.string() + path: z.string().describe("Absolute or relative path of the directory to create. Supports nested paths. Must be within allowed directories.") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: false } @@ -427,7 +427,7 @@ server.registerTool( "prefixes. This tool is essential for understanding directory structure and " + "finding specific files within a directory. Only works within allowed directories.", inputSchema: { - path: z.string() + path: z.string().describe("Absolute or relative path to the directory to list. Must be within allowed directories.") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } @@ -455,7 +455,7 @@ server.registerTool( "prefixes. This tool is useful for understanding directory structure and " + "finding specific files within a directory. Only works within allowed directories.", inputSchema: { - path: z.string(), + path: z.string().describe("Absolute or relative path to the directory to list. Must be within allowed directories."), sortBy: z.enum(["name", "size"]).optional().default("name").describe("Sort entries by name or size") }, outputSchema: { content: z.string() }, @@ -534,8 +534,8 @@ server.registerTool( "Files have no children array, while directories always have a children array (which may be empty). " + "The output is formatted with 2-space indentation for readability. Only works within allowed directories.", inputSchema: { - path: z.string(), - excludePatterns: z.array(z.string()).optional().default([]) + path: z.string().describe("Absolute or relative path to the root directory for the tree. Must be within allowed directories."), + excludePatterns: z.array(z.string()).optional().default([]).describe("Array of glob patterns to exclude from the tree (e.g. ['node_modules', '**/*.log']).") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } @@ -604,8 +604,8 @@ server.registerTool( "operation will fail. Works across different directories and can be used " + "for simple renaming within the same directory. Both source and destination must be within allowed directories.", inputSchema: { - source: z.string(), - destination: z.string() + source: z.string().describe("Absolute or relative path to the source file or directory to move. Must be within allowed directories."), + destination: z.string().describe("Absolute or relative path to the move destination. Must be within allowed directories.") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true } @@ -634,9 +634,9 @@ server.registerTool( "Returns full paths to all matching items. Great for finding files when you don't know their exact location. " + "Only searches within allowed directories.", inputSchema: { - path: z.string(), - pattern: z.string(), - excludePatterns: z.array(z.string()).optional().default([]) + path: z.string().describe("Absolute or relative path to the root directory to search within. Must be within allowed directories."), + pattern: z.string().describe("Glob pattern to match file and directory names (e.g. '*.ts' or '**/*.json')."), + excludePatterns: z.array(z.string()).optional().default([]).describe("Array of glob patterns to exclude from search results (e.g. ['node_modules', '**/*.log']).") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } @@ -662,7 +662,7 @@ server.registerTool( "and type. This tool is perfect for understanding file characteristics " + "without reading the actual content. Only works within allowed directories.", inputSchema: { - path: z.string() + path: z.string().describe("Absolute or relative path to the file or directory to inspect. Must be within allowed directories.") }, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } diff --git a/src/memory/index.ts b/src/memory/index.ts index b560bf1e53..12fa531448 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -265,7 +265,7 @@ server.registerTool( title: "Create Entities", description: "Create multiple new entities in the knowledge graph", inputSchema: { - entities: z.array(EntitySchema) + entities: z.array(EntitySchema).describe("Array of entities to create, each with a name, type, and initial observations.") }, outputSchema: { entities: z.array(EntitySchema) @@ -287,7 +287,7 @@ server.registerTool( title: "Create Relations", description: "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice", inputSchema: { - relations: z.array(RelationSchema) + relations: z.array(RelationSchema).describe("Array of relations to create between existing entities, each specifying source, target, and relation type.") }, outputSchema: { relations: z.array(RelationSchema) @@ -312,7 +312,7 @@ server.registerTool( observations: z.array(z.object({ entityName: z.string().describe("The name of the entity to add the observations to"), contents: z.array(z.string()).describe("An array of observation contents to add") - })) + })).describe("Array of observation sets to add, each targeting a specific entity by name.") }, outputSchema: { results: z.array(z.object({ @@ -363,7 +363,7 @@ server.registerTool( deletions: z.array(z.object({ entityName: z.string().describe("The name of the entity containing the observations"), observations: z.array(z.string()).describe("An array of observations to delete") - })) + })).describe("Array of deletion targets, each specifying an entity and the exact observations to remove from it.") }, outputSchema: { success: z.boolean(), From 1139e0ab0fe44cc66676358fb47041fc70b1e108 Mon Sep 17 00:00:00 2001 From: Radesh Govind Date: Fri, 27 Mar 2026 12:40:48 +0000 Subject: [PATCH 2/2] fix: restore default for count in get-resource-links --- src/everything/tools/get-resource-links.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/everything/tools/get-resource-links.ts b/src/everything/tools/get-resource-links.ts index 976a2f0a5e..b1fc627e20 100644 --- a/src/everything/tools/get-resource-links.ts +++ b/src/everything/tools/get-resource-links.ts @@ -14,6 +14,7 @@ const GetResourceLinksSchema = z.object({ .number() .min(1) .max(10) + .default(3) .describe("Number of resource links to return (1-10)"), });