Skip to main content
Glama
mcollina

MCP Ripgrep Server

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: {}
        }
      }
    ]

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/mcollina/mcp-ripgrep'

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