read_source
Reads numbered code lines from a graph file or definition when facts are not enough, including for repositories on another machine; supports line ranges and pagination.
Instructions
Reads the text of one source file of the graph, or of one definition in it, and returns the lines numbered. Use it when the facts are not enough and the code itself is needed, above all when the repository is on another machine. target is a file path or module ID, a name (total), or <file>::Name when several files define the name; for a name the answer is that definition, from its line to the next definition. first and last are line numbers of the file. One call returns at most 400 lines and says how many are left and where to go on; a very long line is cut and says its length. It reads source files of the graph only: any other path is answered with an error. To find a name first use find_definitions; to find a text use search_source. A name the graph does not hold is answered with an error line, with suggestions when similar names exist.
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": {
"target": "<target>"
},
"name": "read_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| last | No | Last line to return (default: the end of the file or of the definition). | |
| first | No | First line to return (default: the first line of the file or of the definition). | |
| target | Yes | File path or module ID, a name, or <file>::Name. |