Skip to main content
Glama

grape_get_context

Call at the start of each repository task turn to fetch only the context needed now: new, changed, and pinned items, unchanged markers, and stale-context invalidations for the session.

Instructions

Call at the start of every turn on a repository task. Returns the context this session needs now: bodies for new, changed, and pinned items; markers for unchanged items this session already received; and invalidations for earlier context that is now stale. Reuse one sessionId for the whole conversation.

Input Schema

NameRequiredDescriptionDefault
filesNoRepository paths you already know are relevant. They seed retrieval.
queryYesThe current request in plain language. It may change between turns.
testsNoTest files or test names related to the task.
symbolsNoFunction, class, or type names you already know are relevant.
taskTypeNoOptional task category. security_fix, refactor, and migration add stricter evidence and pinning.
agentNameNoClient name, used with agentSessionId instead of sessionId.
sessionIdNoStable id for this conversation. Reuse it every turn: Grape only omits context it already sent to this session.
outputModeNoagent_pack (default) returns item bodies for acting on. full also embeds the stored artifact, dependency refs, and graph for inspection.
tokenBudgetNoOptional token cap for the pack. Optional context is pruned first; required safety context is never pruned.
featureFlagsNo
resetSessionNoSet true when you lost earlier context, for example after compaction. Grape invalidates everything it sent this session and resends it.
agentSessionIdNoThe client's own conversation id, used with agentName instead of sessionId.
environmentScopeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does disclose the non-obvious statefulness: Grape only sends context not already delivered to this session, and marks earlier context as invalidated. It does not mention rate limits, permissions, or what happens if sessionId is unknown/new, leaving small gaps.

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?

Three sentences, no filler, and the most decision-relevant instruction ('call at the start of every turn') is front-loaded before the return-shape details. Every sentence earns its place.

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

Completeness4/5

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

For a 13-parameter, annotation-free tool with no output schema, the description usefully compensates by describing the returned payload in prose. It stops short of covering what an empty or error result looks like, and the tokenBudget pruning behavior lives only in the schema.

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 85%, so parameter meaning is already largely documented (including sessionId reuse and resetSession). The description reinforces session identity continuity but adds no format, precedence, or interaction detail beyond the schema, which is the baseline 3 case.

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?

States a concrete verb and resource ('Returns the context this session needs now') and enumerates the three payload categories: bodies for new/changed/pinned items, markers for unchanged items, and invalidations for stale context. That is well beyond tautology and lets an agent predict the response shape, though it never names a sibling to contrast with, so 5 is not warranted.

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?

'Call at the start of every turn on a repository task' is an explicit trigger, and 'Reuse one sessionId for the whole conversation' plus the resetSession note in the schema give clear lifecycle guidance. It lacks an explicit when-not or a named alternative for cases like inspecting a single artifact, so it stops short of 5.

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