# Read task source

Tool: `veryfront__read_task_source`

Read the editable source behind one task before changing it; returns the task source document with its source text, edit mode and the reasons it can only be edited as source. Requires project.runs.read.

## Arguments

| Name                    | Type                  | Required | Description                                                                                                                                                    |
| ----------------------- | --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference`     | string                |          | Project ID or slug                                                                                                                                             |
| `task_id`               | string                | Yes      | Task ID from list\_tasks                                                                                                                                       |
| `source_target_kind`    | string                |          | Source to read: project or preview\_branch. Defaults to runtime\_target\_kind, then project. One of `project`, `main_branch`, `environment`, `preview_branch`. |
| `target_branch_id`      | string · uuid \| null |          | Preview branch to use when the target kind is preview\_branch.                                                                                                 |
| `runtime_target_kind`   | string \| null        |          | Used as the source target kind when source\_target\_kind is omitted.                                                                                           |
| `target_environment_id` | string · uuid \| null |          | Not supported for source reads; a non-null value is rejected.                                                                                                  |

## 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_task_source",
    "arguments": {
      "task_id": "string"
    }
  }
}'
```

## Example response

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