Skip to main content
Glama

list-file-types

Identify all supported file types for ripgrep searches, enabling efficient and targeted text queries across your system's files using the MCP Ripgrep Server.

Instructions

List all supported file types in ripgrep

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list-file-types' tool. Executes 'rg --type-list --color never' using the exec function, 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" } ] }; }
  • Schema definition for the 'list-file-types' tool, including name, description, and empty input schema, registered in the ListTools response.
    { name: "list-file-types", description: "List all supported file types in ripgrep", inputSchema: { type: "object", properties: {} } }
  • src/index.ts:94-179 (registration)
    Registration of all tools including 'list-file-types' in the ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "search", description: "Search files for patterns using ripgrep (rg)", inputSchema: { type: "object", properties: { pattern: { type: "string", description: "The search pattern (regex by default)" }, path: { type: "string", description: "Directory or file(s) to search." }, caseSensitive: { type: "boolean", description: "Use case sensitive search (default: auto)" }, filePattern: { type: "string", description: "Filter by file type or glob" }, maxResults: { type: "number", description: "Limit the number of matching lines" }, context: { type: "number", description: "Show N lines before and after each match" }, useColors: { type: "boolean", description: "Use colors in output (default: false)" } }, required: ["pattern", "path"] } }, { name: "advanced-search", description: "Advanced search with ripgrep with more options", inputSchema: { type: "object", properties: { pattern: { type: "string", description: "The search pattern (regex by default)" }, path: { type: "string", description: "Directory or file(s) to search." }, caseSensitive: { type: "boolean", description: "Use case sensitive search (default: auto)" }, fixedStrings: { type: "boolean", description: "Treat pattern as a literal string, not a regex" }, filePattern: { type: "string", description: "Filter by file type or glob" }, fileType: { type: "string", description: "Filter by file type (e.g., js, py)" }, maxResults: { type: "number", description: "Limit the number of matching lines" }, context: { type: "number", description: "Show N lines before and after each match" }, invertMatch: { type: "boolean", description: "Show lines that don't match the pattern" }, wordMatch: { type: "boolean", description: "Only show matches surrounded by word boundaries" }, includeHidden: { type: "boolean", description: "Search in hidden files and directories" }, followSymlinks: { type: "boolean", description: "Follow symbolic links" }, showFilenamesOnly: { type: "boolean", description: "Only show filenames of matches, not content" }, showLineNumbers: { type: "boolean", description: "Show line numbers" }, useColors: { type: "boolean", description: "Use colors in output (default: false)" } }, required: ["pattern", "path"] } }, { name: "count-matches", description: "Count matches in files using ripgrep", inputSchema: { type: "object", properties: { pattern: { type: "string", description: "The search pattern (regex by default)" }, path: { type: "string", description: "Directory or file(s) to search." }, caseSensitive: { type: "boolean", description: "Use case sensitive search (default: auto)" }, filePattern: { type: "string", description: "Filter by file type or glob" }, countLines: { type: "boolean", description: "Count matching lines instead of total matches" }, useColors: { type: "boolean", description: "Use colors in output (default: false)" } }, required: ["pattern", "path"] } }, { name: "list-files", description: "List files that would be searched by ripgrep without actually searching them", inputSchema: { type: "object", properties: { path: { type: "string", description: "Directory or file(s) to search." }, filePattern: { type: "string", description: "Filter by file type or glob" }, fileType: { type: "string", description: "Filter by file type (e.g., js, py)" }, includeHidden: { type: "boolean", description: "Include hidden files and directories" } }, required: ["path"] } }, { name: "list-file-types", description: "List all supported file types in ripgrep", inputSchema: { type: "object", properties: {} } } ] }; });

Other Tools

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

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