Skip to main content
Glama

Read docs around a search hit

get_context
Read-onlyIdempotent

Opens any part of the docs (a section or a whole page) as markdown, with links to move around it. Use it on a search_docs hit before answering from it: a hit is one chunk, and often a fragment (a table row without the header that says which column is which plan, one step of a procedure). Pass the hit's chunk_id to get the whole section it is in.

Every result is a node in the page's outline. parent_id goes one level up (to the enclosing section, then the page); children lists the sections one level down; previous_id / next_id move to the neighbouring sections. Pass any of those ids back in. It also takes a docs URL, e.g. a link in the text; a #fragment opens that section. Text over 20,000 characters (a whole Postgres reference page, a long page) comes back in parts: you get the part holding the chunk you passed, and part / part_count say which.

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": {
      "id": "<id>",
      "url": "<url>",
      "part": "<part>"
    },
    "name": "get_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesAny docs id: a chunk_id or section_id from search_docs, a page_id, or a parent_id / children id from an earlier get_context. A chunk_id returns the section the chunk is in. Give this or url.
urlYesA docs URL (tigerdata.com/docs, postgresql.org/docs, postgis.net/docs), e.g. a link found in docs text. With a #fragment it returns that section, otherwise the page. Give this or id.
partYesWhich part of the text to return when part_count > 1. Defaults to the part holding the chunk you passed, else part 1.

Output Schema

NameRequiredDescriptionDefault
idYesThis node: a section_id, or the page_id.
urlYesLink to this node on the docs site.
kindYes
partYesWhich part `text` is, from 1.
textYesThe node as markdown with everything nested under it, led by its parent headings. When part_count > 1 this is one part.
titleYesPage title.
next_idYesThe next section at the same level, under the same parent.
page_idYes
versionYesDocs version, for versioned sources (Postgres, PostGIS).
childrenYesThe sections one level down, in order. Their text is already in `text`; open one by id to read just that part.
headingsYesHeading path of this node, outermost first. Empty for a page.
page_urlYes
parent_idYesThe node one level up (the enclosing section, or the page). Null for a page.
part_countYesAbove 1, call again with `part` for the rest.
previous_idYesThe previous section at the same level, under the same parent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety is covered; beyond that the description adds real behavioral detail, including a 20,000-character truncation threshold and how oversized pages split into parts with part / part_count. It also discloses that every result is an outline node with parent/children/previous/next links, but says nothing about failure behavior for bad ids or inaccessible URLs. Rich context beyond annotations, but not fully exhaustive.

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?

Front-loads the core action and the search_docs handoff in the first sentence, then organizes navigation and pagination into separate paragraphs. It is somewhat long for three parameters, but nearly every sentence carries operational information; the parenthetical examples are illustrative rather than filler.

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?

An output schema exists, so return values need not be enumerated, and the description instead supplies what the schema cannot: the outline navigation model, how fragments resolve, and the parts mechanism for long pages. For a read-only retrieval tool with full schema coverage, an agent has everything needed to call it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, yet the description adds meaning beyond the schema: it says a chunk_id returns the enclosing section rather than the fragment, and that parent_id / children / previous_id / next_id from a previous result can be fed back into `id` — clarifying an id-space union the schema only hints at. The part default ('the part holding the chunk you passed, else part 1') is also restated usefully in context. Noting that outline ids arrive in the response rather than as parameters is the one minor ambiguity.

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?

States a specific verb and resource ('Opens any part of the docs ... as markdown') with the scope stated precisely (a section or a whole page). It explicitly positions itself against the sibling search_docs by saying it is used on a search_docs hit, so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use rule: run it on a search_docs hit before answering from it, with a concrete rationale (a hit is a chunk and often a fragment, e.g. a table row without its header). It also names the alternative entry path (a docs URL from the text, with #fragment for a section), so routing is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.