# Read tool source

Tool: `veryfront__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. Requires project.agents.read.

## Arguments

| Name                    | Type                  | Required | Description                                                                                                                                       |
| ----------------------- | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference`     | string                |          | Project ID or slug                                                                                                                                |
| `tool_id`               | string                | Yes      | Project-defined tool ID returned by list\_tools. This lookup does not load a host executable tool contract.                                       |
| `runtime_target_kind`   | string \| null        |          | Provide the runtime target kind.                                                                                                                  |
| `target_environment_id` | string · uuid \| null |          | Provide the target environment id.                                                                                                                |
| `target_branch_id`      | string · uuid \| null |          | Provide the target branch id.                                                                                                                     |
| `source_target_kind`    | string                |          | The source to read: project (the default), main\_branch (reads as project) or preview\_branch. One of `project`, `main_branch`, `preview_branch`. |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__read_tool_source",
    "arguments": {
      "tool_id": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"id\":\"string\",\"name\":\"string\",\"description\":\"string\",\"source_path\":\"string\",\"source\":\"string\",\"edit_mode\":\"structured\",\"source_only_reasons\":[\"string\"]}"
      }
    ],
    "structuredContent": {
      "id": "string",
      "name": "string",
      "description": "string",
      "source_path": "string",
      "source": "string",
      "edit_mode": "structured",
      "source_only_reasons": [
        "string"
      ]
    }
  }
}
```
