Skip to content

Tools Reference

Read the complete contents of a file, or a specific line range.

ParameterTypeRequiredDescription
pathstringYesPath to the file
start_linenumberNoFirst line to read (1-based, inclusive)
end_linenumberNoLast line to read (1-based, inclusive)
outlinebooleanNoReturn a symbol index (functions, classes, types with line numbers) instead of file contents

Create or overwrite a file with new content. Supports optional backup and chunked streaming for large files.

ParameterTypeRequiredDescription
pathstringYesPath where to write
contentstringYesContent to write
create_backupbooleanNoCreate a .backup copy before overwriting (default: false)
chunk_indexnumberNo0-based chunk index for streaming large files. Omit for single write.
total_chunksnumberNoTotal chunks expected. Required when chunk_index is set.

Replace specific text in a file without rewriting the whole file. Supports intelligent multi-phase matching, literal escape recovery, idempotent edits, and non-blocking no-match.

ParameterTypeRequiredDescription
pathstringYesPath to the file
old_textstringYesText to replace
new_textstringYesReplacement text
dry_runbooleanNoPreview diff without writing (default: false)

Read a media file (image, audio, or other binary) and return it base64-encoded with its MIME type. Returns ImageContent for images so clients can render them inline.

ParameterTypeRequiredDescription
pathstringYesPath to the media file

Copy a file or directory.

ParameterTypeRequiredDescription
sourcestringYesSource path
destinationstringYesDestination path

Move or rename a file or directory.

ParameterTypeRequiredDescription
sourcestringYesSource path
destinationstringYesDestination path

Delete a file or directory.

ParameterTypeRequiredDescription
pathstringYesPath to delete
recursivebooleanNoRecursively delete directories (default: false)

Read multiple files in a single call.

ParameterTypeRequiredDescription
pathsarrayYesList of file paths

Get file or directory metadata (size, permissions, timestamps).

ParameterTypeRequiredDescription
pathstringYesPath to inspect

List directory contents with optional depth. Prefer this over tree or search when you only need what is directly inside a folder — faster and token-efficient.

ParameterTypeRequiredDescription
pathstringYesDirectory path
depthnumberNoHow many levels deep to list (default: 1, max: 10)

Create a directory (including parent directories).

ParameterTypeRequiredDescription
pathstringYesDirectory path

Hierarchical JSON representation of a directory structure.

ParameterTypeRequiredDescription
pathstringYesDirectory to traverse
depthnumberNoMax depth (default: 3)
follow_symlinksbooleanNoFollow symlinks (default: false)

Returns the list of directories the server is allowed to access. No parameters.

Unified file search with three modes.

ParameterTypeRequiredDescription
pathstringYesStarting directory
modestringNo"files" (default), "content", or "duplicates"
patternstringConditionalFilename glob or content regex. Required for files and content modes.
include_contentbooleanNo(content mode) Search inside files. Default: true.
file_typesarrayNo(content mode) Filter by extension, e.g. [".go", ".js"]
context_linesnumberNo(content mode) Lines before/after each match, like grep -C N. Default: 0.

Comprehensive project analysis — language detection, structure, metrics.

ParameterTypeRequiredDescription
pathstringYesProject root directory

Diff-style comparison between two files.

ParameterTypeRequiredDescription
file1stringYesFirst file
file2stringYesSecond file
formatstringNounified, context, or side-by-side (default: unified)

Execute multiple file operations in one call.

ParameterTypeRequiredDescription
operationsarrayYesArray of {type, from, to} objects

Supported types: rename, delete, copy, cp, rm, remove.

Field aliases: source/src/from/path/file for source, destination/dest/dst/to/target for destination, action/type for operation type.

Create step-by-step execution plans for complex operations.

ParameterTypeRequiredDescription
descriptionstringYesTask description
target_filesarrayNoFiles to modify
workspacestringNoWorkspace path

For clients trained on the official MCP filesystem server, these aliases are registered with identical parameter schemas and the same handlers:

Official nameResolves toDescription
read_text_fileread_fileRead file contents
search_filessearchUnified search
directory_treetreeHierarchical directory tree

Both names work — use whichever your client expects.

Returns the full catalog of all 18 tools with usage rules, parameters, and best practices. Call this first in every conversation to ensure all tools are discovered — Claude Desktop’s lazy loading may otherwise miss most tools.

No parameters.

All tools include WithTitleAnnotation() for better display in client UIs. For example, read_file has the title “Read File”.

Response content includes audience annotations so clients can route output appropriately:

Tool typeAudienceReason
Read tools (read_file, search, tree, etc.)["assistant"]Output is for the AI to process, not shown raw to the user
Write tools (write_file, edit_file, etc.)["user", "assistant"]Confirmation should be visible to both

All tools carry MCP hint annotations:

HintMeaning
readOnlyHint: trueTool does not modify the filesystem
destructiveHint: trueTool may delete or overwrite data
idempotentHint: trueCalling multiple times has the same effect

batch_operations and read_multiple_files send notifications/progress updates during execution, allowing clients to show progress bars or status indicators for long-running operations.