Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

search_code

Locate text or code patterns within files using regex and file filters. Supports context lines, custom timeouts, and searches only in allowed directories. Use absolute paths for reliable results.

Instructions

                    Search for text/code patterns within file contents using ripgrep.
                    
                    Use this instead of 'execute_command' with grep/find for searching code content.
                    Fast and powerful search similar to VS Code search functionality.
                    
                    Supports regular expressions, file pattern filtering, and context lines.
                    Has a default timeout of 30 seconds which can be customized.
                    Only searches within allowed directories.
                    
                    IMPORTANT: Always use absolute paths for reliability. Paths are automatically normalized regardless of slash direction. Relative paths may fail as they depend on the current working directory. Tilde paths (~/...) might not work in all contexts. Unless the user explicitly asks for relative paths, use absolute paths.
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextLinesNo
filePatternNo
ignoreCaseNo
includeHiddenNo
maxResultsNo
pathYes
patternYes
timeoutMsNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: default timeout (30 seconds), search constraints (only within allowed directories), path handling requirements (absolute paths recommended), and performance characteristics (fast and powerful). It doesn't mention error handling or output format details, but covers most critical operational aspects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. Each paragraph adds value: purpose, usage guidelines, capabilities, operational constraints, and path guidance. The final sentence about 'DC: ...' references could be trimmed as it's more about external documentation than tool functionality, but overall the structure is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no annotations, no output schema), the description provides substantial context about what the tool does, when to use it, key behaviors, and parameter guidance. It doesn't describe the return format or error conditions, but covers most aspects needed for effective use. The sibling tool differentiation and path guidance are particularly valuable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 8 parameters, the description compensates well by explaining several parameter semantics: it mentions 'regular expressions' (relates to pattern parameter), 'file pattern filtering' (relates to filePattern), 'context lines' (relates to contextLines), and 'timeout' customization (relates to timeoutMs). It also provides crucial guidance about the 'path' parameter requiring absolute paths. However, it doesn't cover all 8 parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for text/code patterns within file contents using ripgrep.' It specifies both the verb ('search') and resource ('text/code patterns within file contents'), and distinguishes it from sibling tools like 'search_files' by emphasizing content search versus file metadata search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool versus alternatives: 'Use this instead of 'execute_command' with grep/find for searching code content.' It also mentions 'Fast and powerful search similar to VS Code search functionality,' helping the agent understand appropriate contexts for its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wonderwhy-er/DesktopCommanderMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server