Context Sherpa exposes a suite of tools through the Model Context Protocol (MCP). These tools allow AI agents to interact with your codebase, perform analysis, and manage coding rules.
These tools leverage Integrated Local Reasoning via your preferred model provider (Ollama or LM Studio) to enable Tier 2 of the Tiered Inference Framework.
Determines which Sherpa tool (Symbolic, Structural, or Semantic) is best suited for a user's high-level query.
- Parameters:
query(string, required): The user's natural language query.
Distills raw code into a concise, 3-sentence functional summary covering Inputs, Outputs, and Side-effects.
- Parameters:
code(string, required): The source code to summarize.
A catch-all tool for asking open-ended semantic questions about code that don't fit other tools.
- Parameters:
prompt(string, required): The question for the local SLM.modelId(string, optional): The specific model to use.max_tokens(number, optional): Max tokens to generate.
Lists all available models from the configured local inference engine (Ollama or LM Studio).
Changes the active default model in the Hub settings.
- Parameters:
modelId(string, required): The ID of the model to set as default.
Requests the local inference engine to download a new model.
- Parameters:
modelId(string, required): The ID of the model to pull (e.g.qwen2.5:0.5b).
These tools use ast-grep to perform precise, pattern-based scanning and rule management.
Scans a code snippet against the project's configured ast-grep rules.
- Parameters:
code(string, required): Source code to scan.language(string, required): Programming language (e.g.,go,python,typescript).sgconfig(string, optional): Path to a specificsgconfig.yml.
Scans a file, directory, or glob pattern for rule violations.
- Parameters:
path(string, required): Path or glob (e.g.,src/**/*.go).language(string, optional): Language filter.
Adds a new rule or updates an existing one in the project.
- Parameters:
rule_id(string, required): Unique ID for the rule.rule_yaml(string, required): The fullast-grepYAML definition.
Deletes a rule from the project.
- Parameters:
rule_id(string, required): The ID of the rule to remove.
Sets up the workspace for ast-grep by creating sgconfig.yml and a rules/ directory.
Searches the Context Sherpa Community Rules for pre-built rules.
Downloads and imports a community rule into your local project.
- Parameters:
rule_id(string, required): ID of the community rule to import.
These tools provide deep knowledge of symbol relationships (definitions and references) using SCIP.
Indexes the workspace for the specified language.
- Parameters:
language(string, optional):go,typescript, orpython. Auto-detects if omitted.
Returns a map of all definitions and references for a given symbol.
- Parameters:
symbolName(string, required): Name of the symbol (e.g.,AuthService).
Lists all classes, functions, and variables defined in a specific file.
- Parameters:
file_path(string, required): Path to the file.
Searches for symbol definitions project-wide matching a query.
- Parameters:
query(string, required): The symbol name or pattern.
Identifies which call sites are most likely to be affected by a change based on SCIP reference data.
- Parameters:
references(string, required): List of SCIP references to triage.