# Create tool

Tool: `veryfront__create_tool`

Create a project tool source file in the project source or a preview branch so project agents can call it; returns the tool source document. Requires project.agents.write.

## Arguments

| Name                 | Type                                   | Required | Description                                                                                                                              |
| -------------------- | -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference`  | string                                 |          | Project ID or slug                                                                                                                       |
| `id`                 | string · min length 1 · max length 128 | Yes      | Tool ID, a lowercase slug; it also names the tool source file.                                                                           |
| `description`        | string \| null                         |          | Tool description. Null leaves it empty. On update, REST and GraphQL clear an omitted description and the MCP tool keeps the current one. |
| `source`             | string · min length 1                  |          | Complete TypeScript source of the tool file. When set it is written as-is and description is ignored.                                    |
| `source_target_kind` | string                                 |          | The source target kind associated with this record.                                                                                      |
| `target_branch_id`   | string · uuid \| null                  |          | The target branch id associated with this record.                                                                                        |

## 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__create_tool",
    "arguments": {
      "id": "a"
    }
  }
}'
```

## 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"
      ]
    }
  }
}
```
