Get Code Snippets
gt_snippetsFetch ranked code snippets from a library’s official docs by topic and language; cached per version with refresh to re-index. Solves finding relevant examples without guessing.
Instructions
Ranked code snippets (title, language, code, source URL) from a library's own docs, by topic and language. Cached per version; refresh:true re-indexes. Prose docs: gt_get_docs. Real-project usage: gt_examples.
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": {
"libraryId": "<libraryId>"
},
"name": "gt_snippets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | Filter, e.g. 'middleware'. Empty = all. | |
| refresh | No | Re-fetch and re-index | |
| version | No | e.g. '15' | |
| language | No | e.g. 'typescript' | |
| libraryId | Yes | Plain name, GroundTruth ID, or docs URL | |
| maxSnippets | No | ||
| projectPath | No | Project root, to read the installed version |