Skip to main content
Glama
mcollina

MCP Ripgrep Server

by mcollina

list-file-types

Discover supported file types for text searches in ripgrep to target specific file formats during system-wide searches.

Instructions

List all supported file types in ripgrep

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'list-file-types' tool. It runs 'rg --type-list --color never', processes the output by stripping ANSI codes, and returns it as text content.
    case "list-file-types": {
      // No colors for type listing
      const command = "rg --type-list --color never";
      
      console.error(`Executing: ${command}`);
      const { stdout, stderr } = await exec(command);
      
      // If there's anything in stderr, log it for debugging
      if (stderr) {
        console.error(`ripgrep stderr: ${stderr}`);
      }
      
      return {
        content: [
          {
            type: "text",
            text: stripAnsiEscapeCodes(stdout) || "Failed to get file types"
          }
        ]
      };
    }
  • src/index.ts:169-177 (registration)
    Registration of the 'list-file-types' tool in the ListTools response, including its name, description, and empty input schema (no parameters required).
      {
        name: "list-file-types",
        description: "List all supported file types in ripgrep",
        inputSchema: {
          type: "object",
          properties: {}
        }
      }
    ]
  • The input schema for 'list-file-types', which is an empty object indicating no input parameters are needed.
        inputSchema: {
          type: "object",
          properties: {}
        }
      }
    ]

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It correctly implies a read-only enumeration with no side effects. For a simple list operation, this is transparent enough.

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, well-structured sentence with no extraneous words. It earns its place by being informative yet brief.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema, distinct siblings), the description fully conveys the tool's purpose without needing additional detail.

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?

The tool has zero parameters, so the baseline is 4. The description adds no parameter info, which is fine since there are none.

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 verb 'list' and the resource 'supported file types in ripgrep'. It distinguishes from sibling tools like 'search' and 'list-files' by focusing specifically on file type enumeration.

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 given on when to use this tool versus alternatives. There is no mention of context, prerequisites, or exclusions.

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