> ## 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.

# Read tool source

> Read the editable source behind one project tool before changing it; returns the tool with its source text, edit mode and the reasons it can only be edited as source.

`veryfront__read_tool_source`

Requires project.agents.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 |
| - | - | - | - |
| `project_reference` | `string` | No | Project ID or slug |
| `tool_id` | `string` | Yes | Project-defined tool ID returned by [`list_tools`](https://veryfront.com/docs/cloud/mcp/tools/list-tools). This lookup does not load a host executable tool contract. |
| `runtime_target_kind` | `string or null` | No | Provide the runtime target kind. |
| `target_environment_id` | `string or null` | No | Provide the target environment id. |
| `target_branch_id` | `string or null` | No | Provide the target branch id. |
| `source_target_kind` | `string` | No | The source to read: project (the default), `main_branch` (reads as project) or `preview_branch`. Values: `"project"`, `"main_branch"`, `"preview_branch"`. |

## 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__read_tool_source",
    "arguments": {
      "tool_id": "example"
    }
  }
}
```

## Result

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

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `id` | `string` | Yes | Unique identifier for the record. |
| `name` | `string` | Yes | Human-readable name for the record. |
| `description` | `string or null` | Yes | Human-readable description for the record. |
| `source_path` | `string` | Yes | The source path associated with this record. |
| `source` | `string` | Yes | The source associated with this record. |
| `edit_mode` | `string` | Yes | The edit mode associated with this record. Values: `"structured"`, `"source_only"`. |
| `source_only_reasons` | `string[]` | Yes | List of source only reasons associated with this record. |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "project_reference": {
      "type": "string",
      "description": "Project ID or slug"
    },
    "tool_id": {
      "type": "string",
      "description": "Project-defined tool ID returned by list_tools. This lookup does not load a host executable tool contract."
    },
    "runtime_target_kind": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "main_branch",
            "environment",
            "preview_branch"
          ],
          "description": "Provide the runtime target kind."
        },
        {
          "type": "null",
          "description": "Provide the runtime target kind."
        }
      ],
      "description": "Provide the runtime target kind."
    },
    "target_environment_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target environment id."
        },
        {
          "type": "null",
          "description": "Provide the target environment id."
        }
      ],
      "description": "Provide the target environment id."
    },
    "target_branch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target branch id."
        },
        {
          "type": "null",
          "description": "Provide the target branch id."
        }
      ],
      "description": "Provide the target branch id."
    },
    "source_target_kind": {
      "type": "string",
      "enum": [
        "project",
        "main_branch",
        "preview_branch"
      ],
      "description": "The source to read: project (the default), main_branch (reads as project) or preview_branch."
    }
  },
  "required": [
    "tool_id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Arguments for the read_tool_source tool."
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the record."
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the record."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable description for the record."
    },
    "source_path": {
      "type": "string",
      "description": "The source path associated with this record."
    },
    "source": {
      "type": "string",
      "description": "The source associated with this record."
    },
    "edit_mode": {
      "type": "string",
      "enum": [
        "structured",
        "source_only"
      ],
      "description": "The edit mode associated with this record."
    },
    "source_only_reasons": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One source only reason item associated with this record."
      },
      "description": "List of source only reasons associated with this record."
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "source_path",
    "source",
    "edit_mode",
    "source_only_reasons"
  ],
  "additionalProperties": false,
  "description": "Structured tool source output schema for MCP tools.",
  "$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__read_tool_source` 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.