Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/everything/tools/get-resource-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
});

Expand Down
7 changes: 2 additions & 5 deletions src/everything/tools/gzip-file-as-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -90,7 +87,7 @@ export const registerGZipFileAsResourceTool = (server: McpServer) => {
const uri = getSessionResourceURI(name);
const blob = compressedBuffer.toString("base64");
const mimeType = "application/gzip";
const resource = <Resource>{ uri, name, mimeType };
const resource = <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(
Expand Down
3 changes: 1 addition & 2 deletions src/everything/tools/trigger-long-running-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions src/filesystem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
});
Expand Down Expand Up @@ -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")
},
Expand All @@ -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({
Expand Down Expand Up @@ -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 }
Expand All @@ -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")
Expand Down Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down Expand Up @@ -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() },
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down
8 changes: 4 additions & 4 deletions src/memory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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({
Expand Down Expand Up @@ -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(),
Expand Down
Loading