Skip to content
Open
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
28 changes: 14 additions & 14 deletions src/filesystem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ server.registerTool(
description: "Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.",
inputSchema: ReadTextFileArgsSchema.shape,
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
readTextFileHandler
);
Expand All @@ -240,7 +240,7 @@ server.registerTool(
head: z.number().optional().describe("If provided, returns only the first N lines of the file")
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
readTextFileHandler
);
Expand All @@ -262,7 +262,7 @@ server.registerTool(
mimeType: z.string()
}))
},
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof ReadMediaFileArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand Down Expand Up @@ -313,7 +313,7 @@ server.registerTool(
.describe("Array of file paths to read. Each path must be a string pointing to a valid file within allowed directories.")
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof ReadMultipleFilesArgsSchema>) => {
const results = await Promise.all(
Expand Down Expand Up @@ -349,7 +349,7 @@ server.registerTool(
content: z.string()
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: true }
annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: true, openWorldHint: false }
},
async (args: z.infer<typeof WriteFileArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand Down Expand Up @@ -379,7 +379,7 @@ server.registerTool(
dryRun: z.boolean().default(false).describe("Preview changes using git-style diff format")
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true }
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true, openWorldHint: false }
},
async (args: z.infer<typeof EditFileArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand All @@ -404,7 +404,7 @@ server.registerTool(
path: z.string()
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: false }
annotations: { readOnlyHint: false, idempotentHint: true, destructiveHint: false, openWorldHint: false }
},
async (args: z.infer<typeof CreateDirectoryArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand All @@ -430,7 +430,7 @@ server.registerTool(
path: z.string()
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof ListDirectoryArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand Down Expand Up @@ -459,7 +459,7 @@ server.registerTool(
sortBy: z.enum(["name", "size"]).optional().default("name").describe("Sort entries by name or size")
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof ListDirectoryWithSizesArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand Down Expand Up @@ -538,7 +538,7 @@ server.registerTool(
excludePatterns: z.array(z.string()).optional().default([])
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof DirectoryTreeArgsSchema>) => {
interface TreeEntry {
Expand Down Expand Up @@ -608,7 +608,7 @@ server.registerTool(
destination: z.string()
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true }
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true, openWorldHint: false }
},
async (args: z.infer<typeof MoveFileArgsSchema>) => {
const validSourcePath = await validatePath(args.source);
Expand Down Expand Up @@ -639,7 +639,7 @@ server.registerTool(
excludePatterns: z.array(z.string()).optional().default([])
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof SearchFilesArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand All @@ -665,7 +665,7 @@ server.registerTool(
path: z.string()
},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async (args: z.infer<typeof GetFileInfoArgsSchema>) => {
const validPath = await validatePath(args.path);
Expand All @@ -691,7 +691,7 @@ server.registerTool(
"before trying to access files.",
inputSchema: {},
outputSchema: { content: z.string() },
annotations: { readOnlyHint: true }
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
},
async () => {
const text = `Allowed directories:\n${allowedDirectories.join('\n')}`;
Expand Down
Loading