Skip to main content
Glama

get_context

Generate a token-budgeted context block from project memory to get relevant history without reading the full summary. Optionally focus on a specific path or keyword for targeted context.

Instructions

Generate a token-budgeted memory context block.

Use when you don't want to read the full summary. ``focus`` (e.g.
'src/auth/') biases the context toward a specific area.

Read-only; assembles a freshly-budgeted context block from
events.jsonl.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
focusNoOptional path prefix or keyword to bias selection toward (e.g., 'src/auth/'). When omitted, the context is project-wide.
tokensNoApproximate target token budget for the returned markdown (default 2000). Output may be slightly over or under as events are included as whole units. Recommended range: 500-8000.
projectNoWhich project this call is about — a registered id, alias, or absolute path (e.g. 'ossdrop'). Omit it when the server was started for a single repo, or when an active project is set with `pjm project use`. Call list_projects to see the registered names.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / project
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Which project this call is about — a registered id, alias, or absolute path (e.g. 'ossdrop'). Omit it when the server was started for a single repo, or when an active project is set with `pjm project use`. Call list_projects to see the registered names.",
      +  "title": "Project"
      +}
  2. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / focus / description
      Added value: +"Optional path prefix or keyword to bias selection toward (e.g., 'src/auth/'). When omitted, the context is project-wide."
    • addedInput schema / properties / tokens / description
      Added value: +"Approximate target token budget for the returned markdown (default 2000). Output may be slightly over or under as events are included as whole units. Recommended range: 500-8000."
    • addedInput schema / properties / tokens / maximum
      Added value: +20000
    • addedInput schema / properties / tokens / minimum
      Added value: +100
  3. First observedv0.1.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and it delivers: 'Read-only' explicitly rules out side effects, and 'assembles a freshly-budgeted context block from events.jsonl' discloses the data source and non-cached, freshly assembled nature. This is exactly the kind of behavioral context an agent needs.

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

Conciseness5/5

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

The description is compact and front-loaded: purpose first, use-case second, behavior note last. Every sentence earns its place; there is no fluff or repetition of schema details.

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

Completeness5/5

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

The description plus the fully-covered schema and existing output schema provide everything needed to decide when to call the tool, what parameters to pass, and what side effects to expect. The project parameter is handled by the schema, including a pointer to list_projects, so no critical guidance is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description's mention of focus only restates what the schema already documents ('Optional path prefix or keyword to bias selection toward'); it adds no meaning beyond the schema for tokens or project.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Generate a token-budgeted memory context block.' It clearly differentiates from get_summary by stating this is for when you don't want to read the full summary, so an agent can distinguish it from the most similar sibling without opening schemas.

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 an explicit condition: 'Use when you don't want to read the full summary.' This implies get_summary as the alternative and covers the main routing concern, though it does not name the sibling tool explicitly or list when-not-to-use cases.

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