Browse documentation

get_file_contents

[analysis]

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

Try it locally in the TGlider playground

Parameters

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

Examples

Replace sample paths and symbol keys with values from your workspace.

Read a focused source window

Arguments
{
  "filePath": "src/app.ts",
  "startLine": 20,
  "lineCount": 80
}
Full MCP request
Full MCP 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.