Skip to main content
Glama

get_context

Read-only

Retrieve focused code context in batches: AST outlines, symbol bodies with imports/types, line matches, and scoped Git diffs, with token-efficient pagination.

Instructions

Batch AST reads. outline: signatures/names. symbol: code with imports/types, or explicit returns only. lines: literal match with contextLines. diff: changes/full scoped by file/symbol. Share a top-level file. Use sources:true for file/symbol labels. Continue with cursor or maxTokens:null.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "requests": "<requests>"
    },
    "name": "get_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNo
cursorNo
sourcesNo
requestsYes
versionsNo
maxTokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.1
    • addedInput schema / properties / file
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / requests / items / properties / contextLines
      Added value: +{
      +  "maximum": 5,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / requests / items / properties / detail / enum
      Previous value: -[
      -  "signatures",
      -  "names",
      -  "full",
      -  "changes"
      -]New value: +[
      +  "signatures",
      +  "names",
      +  "full",
      +  "changes",
      +  "returns"
      +]
    • addedInput schema / properties / sources
      Added value: +{
      +  "type": "boolean"
      +}
  2. First observedv0.2.0

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, destructiveHint:false, and openWorldHint:false, so the safety profile is covered. The description adds useful behavior beyond annotations: operation-specific outputs, top-level file sharing, source labels, and cursor/maxTokens continuation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately short and front-loads the core purpose, then lists operation modes efficiently. The telegraphic phrasing sometimes reduces clarity, but there is little wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a complex tool with nested request objects, multiple operation modes, many parameters, no output schema, and zero schema description coverage. The description covers main usage but is not complete enough to explain the full request model and parameter semantics an agent needs for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning. It explains some operations and parameters such as contextLines, sources, cursor, maxTokens, file, and symbol, but leaves major schema elements unexplained, including requests, find, detail, ifHash, imports, publicOnly, includeTypes, and versions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific resource and action: batch AST reads, with four named operations (outline, symbol, lines, diff). It is clear enough to distinguish what the tool does, though 'AST reads' is somewhat terse and assumes familiarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear context for selecting each operation and for key options: share a top-level file, use sources:true for labels, and continue with cursor or maxTokens:null. It does not provide explicit exclusions or alternative-tool guidance, but no siblings are listed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools