Skip to main content
Glama
nahmanmate

Code Research MCP Server

by nahmanmate

search_all

Search programming resources across multiple platforms simultaneously to find code examples and documentation. Enter a query to get results from Stack Overflow, MDN, GitHub, npm, and PyPI.

Instructions

Search all platforms simultaneously

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
limitNoMaximum results per platform (1-5, default: 3)

Implementation Reference

  • Implements the core logic of the 'search_all' tool by searching multiple platforms (Stack Overflow, MDN, GitHub, npm, PyPI) concurrently, caching results, and formatting the output.
    private async searchAll(query: string, limit: number = 3): Promise<string> {
      const cacheKey = `all:${query}:${limit}`;
      const cached = cache.get<string>(cacheKey);
      if (cached) return cached;
    
      try {
        // Execute non-GitHub searches first
        const [so, mdn, npm, pypi] = await Promise.all([
          this.searchStackOverflow(query, limit).catch(error =>
            `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          ),
          this.searchMDN(query).catch(error =>
            `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          ),
          this.searchNpm(query, limit).catch(error =>
            `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          ),
          this.searchPyPI(query).catch(error =>
            `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          )
        ]);
    
        let results = `=== Stack Overflow Results ===\n${so}\n\n` +
                     `=== MDN Documentation ===\n${mdn}\n\n`;
    
        // Try GitHub search separately
        try {
          const gh = await this.searchGitHub(query, undefined, limit);
          results += `=== GitHub Results ===\n${gh}\n\n`;
        } catch (error) {
          results += `=== GitHub Results ===\nGitHub search currently unavailable\n\n`;
        }
    
        results += `=== npm Packages ===\n${npm}\n\n` +
                  `=== PyPI Packages ===\n${pypi}`;
    
        cache.set(cacheKey, results);
        return results;
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Search all platforms error: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Defines the input schema for the 'search_all' tool, including required 'query' string and optional 'limit' number with constraints.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query'
        },
        limit: {
          type: 'number',
          description: 'Maximum results per platform (1-5, default: 3)',
          minimum: 1,
          maximum: 5
        }
      },
      required: ['query']
    }
  • src/index.ts:412-431 (registration)
    Registers the 'search_all' tool metadata (name, description, schema) in the MCP ListTools response.
    {
      name: 'search_all',
      description: 'Search all platforms simultaneously',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query'
          },
          limit: {
            type: 'number',
            description: 'Maximum results per platform (1-5, default: 3)',
            minimum: 1,
            maximum: 5
          }
        },
        required: ['query']
      }
    }
  • src/index.ts:506-517 (registration)
    Handles incoming calls to the 'search_all' tool in the MCP CallToolRequest handler by extracting arguments and invoking the searchAll method.
    case 'search_all': {
      const { query, limit } = request.params.arguments as { query: string; limit?: number };
      const results = await this.searchAll(query, limit);
      return {
        content: [
          {
            type: 'text',
            text: results
          }
        ]
      };
    }
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. It mentions 'simultaneously', hinting at parallel execution, but doesn't disclose critical behaviors like rate limits, authentication needs, error handling, or what 'all platforms' entails (e.g., which ones). For a search tool with no annotation coverage, this leaves significant gaps in understanding how it operates.

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 waste. It's front-loaded and appropriately sized for its purpose, making it easy to parse quickly 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?

Given the complexity of searching multiple platforms, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'platforms' are, how results are returned (e.g., aggregated, formatted), or any behavioral constraints. For a tool with 2 parameters and sibling alternatives, more context is needed to guide effective use.

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 clear documentation for 'query' and 'limit' parameters. The description adds no additional meaning beyond the schema, such as query syntax examples or platform-specific nuances. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but no extra value is provided.

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

Purpose3/5

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

The description 'Search all platforms simultaneously' states the action (search) and scope (all platforms), but it's vague about what 'platforms' refers to. It doesn't specify the verb's target (e.g., 'code repositories', 'documentation') or distinguish from siblings like search_github which target specific platforms. The purpose is understandable but lacks specificity.

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?

No guidance is provided on when to use this tool versus the sibling tools (search_github, search_mdn, etc.). The description implies it searches across multiple platforms, but it doesn't specify if this is for broad queries, cross-platform needs, or as an alternative to individual platform searches. Without explicit when/when-not instructions, the agent must infer usage.

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/nahmanmate/code-research-mcp-server'

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