fix(filesystem): mark move_file as destructive operation
move_file deletes the source file, which is a destructive operation. Updated annotations and README documentation to reflect this. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
55a3056a04
commit
86fd903d5f
2 changed files with 2 additions and 2 deletions
|
|
@ -200,7 +200,7 @@ The mapping for filesystem tools is:
|
||||||
| `create_directory` | `false` | `true` | `false` | Re‑creating the same dir is a no‑op |
|
| `create_directory` | `false` | `true` | `false` | Re‑creating the same dir is a no‑op |
|
||||||
| `write_file` | `false` | `true` | `true` | Overwrites existing files |
|
| `write_file` | `false` | `true` | `true` | Overwrites existing files |
|
||||||
| `edit_file` | `false` | `false` | `true` | Re‑applying edits can fail or double‑apply |
|
| `edit_file` | `false` | `false` | `true` | Re‑applying edits can fail or double‑apply |
|
||||||
| `move_file` | `false` | `false` | `false` | Move/rename only; repeat usually errors |
|
| `move_file` | `false` | `false` | `true` | Deletes source file |
|
||||||
|
|
||||||
> Note: `idempotentHint` and `destructiveHint` are meaningful only when `readOnlyHint` is `false`, as defined by the MCP spec.
|
> Note: `idempotentHint` and `destructiveHint` are meaningful only when `readOnlyHint` is `false`, as defined by the MCP spec.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -589,7 +589,7 @@ server.registerTool(
|
||||||
destination: z.string()
|
destination: z.string()
|
||||||
},
|
},
|
||||||
outputSchema: { content: z.string() },
|
outputSchema: { content: z.string() },
|
||||||
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: false }
|
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true }
|
||||||
},
|
},
|
||||||
async (args: z.infer<typeof MoveFileArgsSchema>) => {
|
async (args: z.infer<typeof MoveFileArgsSchema>) => {
|
||||||
const validSourcePath = await validatePath(args.source);
|
const validSourcePath = await validatePath(args.source);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue