Skip to main content
Glama

docs_search

Search project documentation to find relevant information for development tasks within the CastPlan MCP server.

Instructions

Search through project documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find relevant documentation

Implementation Reference

  • The handler function for the 'docs_search' MCP tool. It receives arguments, calls the DocumentationService.searchDocumentation method with the query, and returns the results wrapped with the original query.
    tools.set('docs_search', async (args: any) => {
      const searchResults = await documentationService.searchDocumentation(args.query);
      return { query: args.query, results: searchResults };
    });
  • The input schema definition for the 'docs_search' tool, specifying that it requires a 'query' string parameter.
    {
      name: 'docs_search',
      description: 'Search through project documentation',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query to find relevant documentation'
          }
        },
        required: ['query']
      }
    },
  • src/index.ts:410-412 (registration)
    Top-level registration of documentation tools (including 'docs_search') into the main tools map and toolDefinitions array during server initialization.
    if (this.config.services.documentation && this.documentationService) {
      const docTools = registerDocumentationTools(this.tools, this.documentationService);
      this.toolDefinitions.push(...docTools);
  • Core implementation of documentation search in DocumentationService. Scans markdown files in documentation directories for matches to the query string and returns matching DocumentInfo objects.
    async searchDocumentation(query: string): Promise<DocumentInfo[]> {
      const allDocs: DocumentInfo[] = [];
      
      // Search in all documentation directories
      const searchDirs = [this.docsRoot, this.masterDocs];
      
      for (const searchDir of searchDirs) {
        if (this.fs.existsSync(searchDir)) {
          const files = await this.scanDirectory(searchDir, '.md');
          
          for (const file of files) {
            try {
              const content = this.fs.readFileSync(file, 'utf8');
              if (content.toLowerCase().includes(query.toLowerCase())) {
                allDocs.push({
                  path: file,
                  category: this.path.relative(this.projectRoot, this.path.dirname(file)),
                  relevance: 'medium',
                  lastModified: this.fs.statSync(file).mtime
                });
              }
            } catch (error: any) {
              console.warn(`Error searching file ${file}: ${error.message}`);
            }
          }
        }
      }
      
      return allDocs;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Search through project documentation' implies a read-only operation but doesn't specify what gets returned (full documents, snippets, metadata), whether there are rate limits, authentication requirements, or how results are ranked/formatted. This leaves significant behavioral questions unanswered.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple search tool and front-loads the essential information without unnecessary elaboration.

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

Completeness2/5

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

For a search tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format results come in, whether there are limitations (like maximum results), or how the search works (full-text, keyword, etc.). Given the lack of structured data elsewhere, the description should provide more operational context.

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

Parameters3/5

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

Schema description coverage is 100% with the single 'query' parameter well-documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides ('Search query to find relevant documentation'), so it meets the baseline for adequate but unenhanced parameter documentation.

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

Purpose4/5

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

The description clearly states the verb ('Search') and resource ('project documentation'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling search tools like 'docs_reference' or 'get_document_tree', which might also involve finding documentation content.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'docs_reference', 'get_document_tree', and 'analyze_document_quality' that might also help find documentation information, there's no indication of when this search function is preferred or what specific use cases it addresses.

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

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/Ghostseller/CastPlan_mcp'

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