get_file_contents

[analysis]

Reads a bounded text window from a file inside the loaded workspace.

Why this tool exists

Agents need enough file and API context to act without dumping entire source files into the prompt.

How it helps the agent

The model can read bounded source windows, outlines, and export surfaces before choosing the next specific tool.

Try it locally in the TGlider playground

Parameters

NameTypeRequiredDescription
filePathstringYesWorkspace-relative or absolute file path.
startLinenumberNoFirst 1-based line to read.
lineCountnumberNoMaximum number of lines to read.

Examples

Read a focused source window

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_file_contents",
    "arguments": {
      "filePath": "src/app.ts",
      "startLine": 20,
      "lineCount": 80
    }
  }
}

Response Notes

Returns a bounded text window, total line metadata, and live-document version state.

↑/↓ NavigateEnter OpenSpace Expand