Skip to main content
Glama

Get project file

get_file
Read-onlyIdempotent

Reads project files with secrets and private data redacted, supporting single files, line ranges, symbols, and batched requests after project tree or search results.

Instructions

Reads project files with secrets and configured private data replaced. Use it after get_tree or search_project; use batched requests for several known files. path reads one file, optionally with start_line/end_line or symbol; paths reads up to sixteen whole files; requests mixes files, ranges, and symbols: requests=[{"path":"src/a.ts","symbol":"Router.load"}]. A batch returns files whole in the order asked, within 50,000 characters; a large file, or one that no longer fits, returns its structure with line ranges. Items report ok, structure, partial, not-returned, or unavailable. Line numbers refer to returned text.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoOne file, or an array of up to sixteen whole files. Give path, paths, or requests; path and paths may accompany requests and add whole-file reads. Names an existing selected file; Markdown escapes from the default get_tree format are accepted, while format=text supplies literal names.
pathsNoUp to sixteen files read whole in one call; with start_line and end_line, the same lines are read from each file.
symbolNoReads a qualified, or file-unique simple, declaration with path instead of a range; search_project supplies names. Cannot combine with line or column fields; missing, unavailable, or non-unique declarations return DPX-MCP-INVALID-ARGUMENTS.
end_lineNoLast inclusive 1-based returned-text line; accepts integer or numeric string.
requestsNoBatch form: up to sixteen files and sixteen selections; a path reads the whole file, while ranges or symbol narrow it. start_line, end_line, and start_column cannot accompany requests.
start_lineNoFirst 1-based returned-text line; accepts integer or numeric string.
start_columnNoFirst 1-based Unicode character on start_line; use a returned continuation value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 schema fields changedv5.2.5
    • removedInput schema / properties / branch
      Removed value: -{
      -  "description": "Remote Git branch; invalid for local projects.",
      -  "minLength": 1,
      -  "type": "string"
      -}
    • changedInput schema / properties / end_line / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / path / description
      Previous value: -"Single-file form. Exactly one of path or requests is required. Names an existing selected file; Markdown escapes from the default get_tree format are accepted, while format=text supplies literal names."New value: +"One file, or an array of up to sixteen whole files. Give path, paths, or requests; path and paths may accompany requests and add whole-file reads. Names an existing selected file; Markdown escapes from the default get_tree format are accepted, while format=text supplies literal names."
    • removedInput schema / properties / path / minLength
      Removed value: -1
    • addedInput schema / properties / path / oneOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / path / type
      Removed value: -"string"
    • addedInput schema / properties / paths
      Added value: +{
      +  "description": "Up to sixteen files read whole in one call; with start_line and end_line, the same lines are read from each file.",
      +  "oneOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  ]
      +}
    • removedInput schema / properties / profile
      Removed value: -{
      -  "description": "Selection profile: standard uses all eight exclusion toggles plus gitignore; local uses the desktop profile listed by list_projects.profiles; otherwise give a portable profile path inside the project.",
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / project
      Removed value: -{
      -  "description": "unique listed name, absolute path returned by list_projects, or #index.",
      -  "type": "string"
      -}
    • changedInput schema / properties / requests / description
      Previous value: -"Batch form. Exactly one of requests or path is required. Reads up to eight files and sixteen selections; a path reads the whole file, while ranges or symbol narrow it. Single-file ranges cannot accompany requests."New value: +"Batch form: up to sixteen files and sixteen selections; a path reads the whole file, while ranges or symbol narrow it. start_line, end_line, and start_column cannot accompany requests."
    • removedInput schema / properties / requests / items / properties / path / maxLength
      Removed value: -4096
    • removedInput schema / properties / requests / items / properties / path / minLength
      Removed value: -1
    • changedInput schema / properties / requests / items / properties / ranges / items / properties / end_line / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / requests / items / properties / ranges / items / properties / start_line / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / requests / items / properties / ranges / maxItems
      Removed value: -16
    • removedInput schema / properties / requests / items / properties / ranges / minItems
      Removed value: -1
    • removedInput schema / properties / requests / items / properties / symbol / maxLength
      Removed value: -512
    • removedInput schema / properties / requests / items / properties / symbol / minLength
      Removed value: -1
    • removedInput schema / properties / requests / maxItems
      Removed value: -8
    • removedInput schema / properties / requests / minItems
      Removed value: -1
    • changedInput schema / properties / start_column / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / start_line / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / symbol / minLength
      Removed value: -1
  2. Changed10 schema fields changedv5.2.0
    • changedInput schema / properties / branch / description
      Previous value: -"Optional Git branch for a remote project URL; invalid for local project paths."New value: +"Remote Git branch; invalid for local projects."
    • changedInput schema / properties / end_line / description
      Previous value: -"Last 1-based line, inclusive; integer or numeric string."New value: +"Last inclusive 1-based returned-text line; accepts integer or numeric string."
    • changedInput schema / properties / path / description
      Previous value: -"Existing file path inside the effective project selection."New value: +"Single-file form. Exactly one of path or requests is required. Names an existing selected file; Markdown escapes from the default get_tree format are accepted, while format=text supplies literal names."
    • addedInput schema / properties / profile
      Added value: +{
      +  "description": "Selection profile: standard uses all eight exclusion toggles plus gitignore; local uses the desktop profile listed by list_projects.profiles; otherwise give a portable profile path inside the project.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / project / description
      Previous value: -"Absolute root path returned by list_projects, or a Git URL when the server allows remote sources. Optional only when one local root is configured."New value: +"unique listed name, absolute path returned by list_projects, or #index."
    • addedInput schema / properties / requests
      Added value: +{
      +  "description": "Batch form. Exactly one of requests or path is required. Reads up to eight files and sixteen selections; a path reads the whole file, while ranges or symbol narrow it. Single-file ranges cannot accompany requests.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "path": {
      +        "description": "Existing selected project file.",
      +        "maxLength": 4096,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "ranges": {
      +        "description": "Inclusive transformed-text line ranges for this file.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "end_line": {
      +              "description": "Last inclusive 1-based transformed-text line.",
      +              "oneOf": [
      +                {
      +                  "minimum": 1,
      +                  "type": "integer"
      +                },
      +                {
      +                  "pattern": "^0*[1-9][0-9]*$",
      +                  "type": "string"
      +                }
      +              ]
      +            },
      +            "start_line": {
      +              "description": "First 1-based transformed-text line.",
      +              "oneOf": [
      +                {
      +                  "minimum": 1,
      +                  "type": "integer"
      +                },
      +                {
      +                  "pattern": "^0*[1-9][0-9]*$",
      +                  "type": "string"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [
      +            "start_line",
      +            "end_line"
      +          ],
      +          "type": "object"
      +        },
      +        "maxItems": 16,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "symbol": {
      +        "description": "Reads this named declaration instead of ranges; the two forms cannot combine.",
      +        "maxLength": 512,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 8,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / start_column
      Added value: +{
      +  "description": "First 1-based Unicode character on start_line; use a returned continuation value.",
      +  "oneOf": [
      +    {
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "pattern": "^0*[1-9][0-9]*$",
      +      "type": "string"
      +    }
      +  ]
      +}
    • changedInput schema / properties / start_line / description
      Previous value: -"First 1-based line; integer or numeric string."New value: +"First 1-based returned-text line; accepts integer or numeric string."
    • addedInput schema / properties / symbol
      Added value: +{
      +  "description": "Reads a qualified, or file-unique simple, declaration with path instead of a range; search_project supplies names. Cannot combine with line or column fields; missing, unavailable, or non-unique declarations return DPX-MCP-INVALID-ARGUMENTS.",
      +  "maxLength": 512,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "path"
      -]
  3. First observedv5.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/idempotentHint/non-destructive, yet the description adds substantial behavior beyond them: output is redacted, batches are bounded at 50,000 characters, oversized or no-longer-fitting files degrade to a structure-with-ranges response, and items carry ok/structure/partial/not-returned/unavailable status. It also warns that line numbers refer to returned (transformed) text, which is a real correctness trap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and sequencing, then the three modes, then failure semantics, ordering by what the agent needs first. The text is dense to the point of being a single wall of clauses with semicolons, which costs a bit of scanability, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Seven parameters, no output schema, and a tool with non-obvious degradation behavior — the description fills all of that by explaining what a response item looks like (statuses) and how truncation is represented. Nothing needed to invoke it correctly or interpret a degraded result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns an extra point by supplying a concrete request example (requests=[{"path":"src/a.ts","symbol":"Router.load"}]) and by stating the interaction rules between parameter groups (which fields combine and which cannot accompany requests). It stops short of explaining start_line/end_line vs start_column beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb and resource ("Reads project files") plus a distinguishing behavior the siblings don't have: secrets and configured private data are replaced. Naming get_tree and search_project as upstream steps separates it from those siblings without requiring the agent to open any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit sequencing guidance ("Use it after get_tree or search_project") and explicit mode selection ("use batched requests for several known files"), then a mode-by-mode breakdown of path vs paths vs requests with the sixteen-item cap. An agent knows which of the three invocation shapes to pick without inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.