Skip to main content
Glama

Code Reference Optimizer MCP Server

by FosterG4

extract_code_context

Parse source files using AST to extract targeted code context and relevant imports, optimizing token usage for AI-based code analysis and assistance. Supports TypeScript, JavaScript, Python, Go, and Rust.

Instructions

Extract minimal code context from files using AST parsing

Input Schema

NameRequiredDescriptionDefault
filePathYesPath to the source file
includeImportsNoWhether to include relevant imports
maxTokensNoMaximum tokens to return
targetSymbolsNoSpecific symbols/functions to extract context for

Input Schema (JSON Schema)

{ "properties": { "filePath": { "description": "Path to the source file", "type": "string" }, "includeImports": { "default": true, "description": "Whether to include relevant imports", "type": "boolean" }, "maxTokens": { "default": 1000, "description": "Maximum tokens to return", "type": "number" }, "targetSymbols": { "description": "Specific symbols/functions to extract context for", "items": { "type": "string" }, "type": "array" } }, "required": [ "filePath" ], "type": "object" }

Other Tools from Code Reference Optimizer MCP Server

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/FosterG4/mcpsaver'

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