Skip to main content
Glama

Octocode MCP

by bgauryy

githubGetFileContent

Fetch content from multiple GitHub repository files simultaneously with up to 5 parallel queries. Optimize token usage by accessing partial file sections and enable automatic fallback handling for efficient workflow integration.

Instructions

Fetches the content of multiple files from GitHub repositories in parallel. Supports up to 5 queries with automatic fallback handling.

TOKEN OPTIMIZATION:

  • Full file content is expensive in tokens. Use startLine/endLine for partial access
  • Large files should be accessed in parts rather than full content
  • Use minified=true (default) to optimize content for token efficiency

BULK QUERY FEATURES:

  • queries: array of up to 5 different file fetch queries for parallel execution
  • Each query can have fallbackParams for automatic retry with modified parameters
  • Optimizes workflow by executing multiple file fetches simultaneously
  • Each query should target different files or sections
  • Fallback logic automatically adjusts parameters if original query fails
  • Automatic main/master branch fallback for each query

Use for comprehensive file analysis - query different files, sections, or implementations in one call.

Input Schema

NameRequiredDescriptionDefault
queriesYesArray of up to 5 different file fetch queries for parallel execution

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "queries": { "description": "Array of up to 5 different file fetch queries for parallel execution", "items": { "additionalProperties": false, "properties": { "branch": { "description": "Branch name, tag name, OR commit SHA. Tool will automatically try 'main' and 'master' if specified branch is not found.", "maxLength": 255, "minLength": 1, "pattern": "^[^\\s]+$", "type": "string" }, "contextLines": { "default": 5, "description": "Context lines around target range. Default: 5.", "maximum": 50, "minimum": 0, "type": "integer" }, "endLine": { "description": "Ending line number (1-based) for partial file access. Use with startLine to fetch only specific sections and save tokens.", "minimum": 1, "type": "integer" }, "fallbackParams": { "additionalProperties": false, "description": "Fallback parameters if original query returns no results", "properties": { "branch": { "type": "string" }, "contextLines": { "maximum": 50, "minimum": 0, "type": "integer" }, "endLine": { "minimum": 1, "type": "integer" }, "filePath": { "type": "string" }, "minified": { "type": "boolean" }, "startLine": { "minimum": 1, "type": "integer" } }, "type": "object" }, "filePath": { "description": "File path from repository root (e.g., 'src/index.js', 'README.md', 'docs/api.md'). Do NOT start with slash.", "minLength": 1, "type": "string" }, "id": { "description": "Optional identifier for the query", "type": "string" }, "minified": { "default": true, "description": "Optimize content for token efficiency (enabled by default). Removes excessive whitespace and comments. Set to false only when exact formatting is required.", "type": "boolean" }, "owner": { "description": "Repository owner/organization name (e.g., 'facebook', 'microsoft'). Do NOT include repository name here.", "maxLength": 100, "minLength": 1, "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$", "type": "string" }, "repo": { "description": "Repository name only (e.g., 'react', 'vscode'). Do NOT include owner/org prefix.", "maxLength": 100, "minLength": 1, "pattern": "^[a-zA-Z0-9._-]+$", "type": "string" }, "startLine": { "description": "Starting line number (1-based) for partial file access. STRONGLY RECOMMENDED to save tokens instead of fetching full file content.", "minimum": 1, "type": "integer" } }, "required": [ "owner", "repo", "branch", "filePath" ], "type": "object" }, "maxItems": 5, "minItems": 1, "type": "array" } }, "required": [ "queries" ], "type": "object" }
Install Server

Other Tools from Octocode MCP

Related Tools

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/bgauryy/octocode-mcp'

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