> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get file diff

> Return file diff.

`veryfront__get_file_diff`

Requires project.files.read.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Read-only.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `file_path` | `string` | Yes | Project-relative source path, or the file ID. Minimum length: `1`. |
| `ref` | `string` | No | Content to read: main, branch:\<name-or-id>, release:\<version> or env:\<name>. Omit for main. |
| `source_ref` | `string` | No | Version ID to compare from. Required except on a branch, which compares against main. |
| `context_lines` | `integer` | No | Context lines around a change, 0 to 10 (default 3). Minimum: `0`. Maximum: `10`. |
| `project_reference` | `string` | No | Project ID or slug (defaults to the current project) |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](https://veryfront.com/docs/cloud/getting-started/connect-mcp.md).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__get_file_diff",
    "arguments": {
      "file_path": "example"
    }
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required |
| - | - | - |
| `path` | `string` | Yes |
| `diff` | `string` | Yes |
| `additions` | `number` | Yes |
| `deletions` | `number` | Yes |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "file_path": {
      "type": "string",
      "minLength": 1,
      "description": "Project-relative source path, or the file ID."
    },
    "ref": {
      "type": "string",
      "description": "Content to read: main, branch:<name-or-id>, release:<version> or env:<name>. Omit for main."
    },
    "source_ref": {
      "type": "string",
      "description": "Version ID to compare from. Required except on a branch, which compares against main."
    },
    "context_lines": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10,
      "description": "Context lines around a change, 0 to 10 (default 3)."
    },
    "project_reference": {
      "type": "string",
      "description": "Project ID or slug (defaults to the current project)"
    }
  },
  "required": [
    "file_path"
  ],
  "additionalProperties": false,
  "description": "Arguments for the get_file_diff tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string"
    },
    "diff": {
      "type": "string"
    },
    "additions": {
      "type": "number"
    },
    "deletions": {
      "type": "number"
    }
  },
  "required": [
    "path",
    "diff",
    "additions",
    "deletions"
  ],
  "additionalProperties": false,
  "description": "Structured result returned by the get_file_diff tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

<details>
  <summary>Try this tool</summary>

  Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.

  MCP tool call

  Call `veryfront__get_file_diff` against the Veryfront MCP endpoint.

  Bearer token or API key

  Arguments (JSON)

  Run tool

  Output JSON

  <pre />
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.