Read docs around a search hit
get_contextOpens 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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Any 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. | |
| url | Yes | A 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. | |
| part | Yes | Which part of the text to return when part_count > 1. Defaults to the part holding the chunk you passed, else part 1. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | This node: a section_id, or the page_id. | |
| url | Yes | Link to this node on the docs site. | |
| kind | Yes | ||
| part | Yes | Which part `text` is, from 1. | |
| text | Yes | The node as markdown with everything nested under it, led by its parent headings. When part_count > 1 this is one part. | |
| title | Yes | Page title. | |
| next_id | Yes | The next section at the same level, under the same parent. | |
| page_id | Yes | ||
| version | Yes | Docs version, for versioned sources (Postgres, PostGIS). | |
| children | Yes | The sections one level down, in order. Their text is already in `text`; open one by id to read just that part. | |
| headings | Yes | Heading path of this node, outermost first. Empty for a page. | |
| page_url | Yes | ||
| parent_id | Yes | The node one level up (the enclosing section, or the page). Null for a page. | |
| part_count | Yes | Above 1, call again with `part` for the rest. | |
| previous_id | Yes | The previous section at the same level, under the same parent. |