Stellarion
Tools

stellarion_get_edit_context

Assembles source, callers, tests, memories, and git history for editing code

A single-call tool that gathers everything you need before modifying code at a specific location. It bundles the function source, all callers that would be affected, related tests, relevant memories, and recent git history into one response.

When to Use

  • About to modify a function's signature or behavior
  • Refactoring code and need to know what will break
  • Fixing a bug and want to see related tests and recent changes
  • Any time you need the full picture before writing code

Use stellarion_get_ai_context instead when you only need to understand or explain code without making changes.

Parameters

ParameterTypeRequiredDefaultDescription
uristringYes--File URI of the code being edited (e.g., file:///path/to/file.ts)
linenumberYes--Line number being edited (0-indexed)
maxTokensnumberNo8000Maximum tokens of context to return. Priority order: symbol > callers > tests > memories > git history.

Examples

Before Modifying a Function Signature

Natural Language: "I need to add a timeout parameter to fetchUserProfile"

MCP Tool Call:

{
  "name": "stellarion_get_edit_context",
  "arguments": {
    "uri": "file:///home/dev/project/src/api/users.ts",
    "line": 34
  }
}

Returns: Full source of fetchUserProfile, all 7 callers that would need updating, 3 test functions that call it, a memory noting "fetchUserProfile was recently refactored to use async/await", and 2 recent commits touching this file.

Fixing a Bug

Natural Language: "There's an off-by-one error in the pagination logic"

MCP Tool Call:

{
  "name": "stellarion_get_edit_context",
  "arguments": {
    "uri": "file:///home/dev/project/src/db/pagination.rs",
    "line": 72,
    "maxTokens": 12000
  }
}

Returns: Full source of the pagination function, callers from API handlers, existing test cases for boundary conditions, a known_issue memory about "pagination breaks on empty result sets", and git log showing the last 3 changes to the file.

Output Format

The response contains 5 sections, filled within the token budget in priority order:

  1. symbol -- Full source code of the function or method at the given line. Always included.
  2. callers -- Functions that call this symbol. Shows name, file, and line for each caller so you can assess impact.
  3. tests -- Related test functions that exercise this code. Includes test name, file, and relationship type.
  4. memories -- Relevant debug notes, architectural decisions, known issues, and conventions. Surfaced by hybrid search over the memory store.
  5. recentChanges -- Recent git commits that touched this file. Includes commit hash, message, author, and date.

Tips

  • This tool has a larger default token budget (8000) than get_ai_context (4000) because it includes more context sections. Increase it further for complex functions.
  • The callers section is critical before signature changes. Every caller listed is a site you need to update.
  • Check the memories section for past decisions -- someone may have already tried what you are about to do.
  • The git history section helps avoid conflicts. If someone recently changed the same code, coordinate before making further changes.
  • For a quick check without the full context, use stellarion_get_symbol_info instead -- it returns just the metadata.