Skip to main content
Glama
angrysky56

Advanced Reasoning MCP Server

search_system_json

Search system JSON files by query to find matching documents with relevance scores for enhanced reasoning workflows.

Instructions

Search through system JSON files by query.

Parameters:

  • query: Search query to find matching system JSON files (required)

Returns matching files with relevance scores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find matching system JSON files

Implementation Reference

  • Core implementation of searchSystemJSON in SystemJSON class: reads all .json files in system_json directory, parses content, calculates relevance score based on query matching searchable_content, filters scores >0.1, sorts by score descending.
    async searchSystemJSON(query: string): Promise<{ results: Array<{ name: string; score: number; data: SystemJSONData }> }> {
      try {
        const files = await fs.readdir(this.systemJsonPath);
        const results: Array<{ name: string; score: number; data: SystemJSONData }> = [];
    
        for (const file of files) {
          if (file.endsWith('.json') && !file.endsWith('.tmp')) {
            try {
              const filePath = path.join(this.systemJsonPath, file);
              const jsonContent = await fs.readFile(filePath, 'utf-8');
              const data = JSON.parse(jsonContent) as SystemJSONData;
    
              const score = this.calculateSearchScore(query, data);
              if (score > 0.1) {
                results.push({ name: data.name, score, data });
              }
            } catch (error) {
              // Skip corrupted files
              console.error(`Skipping corrupted system JSON file: ${file}`, error);
            }
          }
        }
    
        return { results: results.sort((a, b) => b.score - a.score) };
      } catch (error) {
        console.error('Failed to search system JSON:', error);
        return { results: [] };
      }
    }
  • Wrapper handler in AdvancedReasoningServer that invokes core SystemJSON.searchSystemJSON and formats the results into MCP-compatible response content (JSON string with summarized results).
    public async searchSystemJSON(query: string): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> {
      try {
        const result = await this.systemJson.searchSystemJSON(query);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              query,
              results: result.results.map(r => ({
                name: r.name,
                score: r.score,
                domain: r.data.domain,
                description: r.data.description,
                tags: r.data.tags
              })),
              totalResults: result.results.length
            }, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: error instanceof Error ? error.message : String(error),
              status: 'failed'
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • MCP server dispatch handler for 'search_system_json' tool: extracts 'query' from arguments and delegates to reasoningServer.searchSystemJSON.
    case "search_system_json":
      const { query: searchQuery } = args as { query: string };
      return await reasoningServer.searchSystemJSON(searchQuery);
  • src/index.ts:1349-1364 (registration)
    Tool registration object defining name, description, and inputSchema for 'search_system_json', which is included in the server's tools list.
    const SEARCH_SYSTEM_JSON_TOOL: Tool = {
      name: "search_system_json",
      description: `Search through system JSON files by query.
    
    Parameters:
    - query: Search query to find matching system JSON files (required)
    
    Returns matching files with relevance scores.`,
      inputSchema: {
        type: "object",
        properties: {
          query: { type: "string", description: "Search query to find matching system JSON files" }
        },
        required: ["query"]
      }
    };
  • Input schema specifying the required 'query' string parameter for the search_system_json tool.
    inputSchema: {
      type: "object",
      properties: {
        query: { type: "string", description: "Search query to find matching system JSON files" }
      },
      required: ["query"]
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns 'matching files with relevance scores,' which adds some context about output format. However, it lacks details on permissions, rate limits, error handling, or whether this is a read-only operation (implied by 'search' but not explicit). For a tool with zero annotation coverage, this is a significant gap in behavioral transparency.

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 stated first. The two sentences are efficient, though the parameter section could be integrated more smoothly. There's no wasted text, but it could be slightly more structured (e.g., merging the parameter note into the main description).

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

Completeness3/5

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

Given the tool's moderate complexity (search operation with one parameter), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and output format but lacks details on behavioral traits, usage context, and parameter nuances. Without annotations or output schema, it should do more to be complete, but it meets the bare minimum for a simple search tool.

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?

The description adds minimal meaning beyond the input schema. It repeats the parameter name and its purpose ('Search query to find matching system JSON files'), which is already covered in the schema description (100% coverage). No additional details like query syntax, examples, or constraints are provided. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra value.

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 tool's purpose: 'Search through system JSON files by query.' This specifies the verb (search), resource (system JSON files), and mechanism (by query). However, it doesn't explicitly differentiate from sibling tools like 'list_system_json' or 'get_system_json', which might offer different approaches to accessing JSON files.

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. It doesn't mention sibling tools like 'list_system_json' (which might list all files without search) or 'get_system_json' (which might retrieve a specific file), leaving the agent to infer usage context. There's no explicit when/when-not or alternative recommendations.

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/angrysky56/advanced-reasoning-mcp'

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