# Create schedule

Tool: `veryfront__create_schedule`

Create a recurring schedule that starts a task, a workflow or an agent on a cron expression, or, on REST and GraphQL only, activate a schedule declared in source (the MCP tool creates manual schedules only); returns the schedule: a new schedule is active, and a source schedule that was activated before keeps its current status. Requires project.runs.write.

## Arguments

| Name                            | Type                                   | Required | Description                                                                                    |
| ------------------------------- | -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------- |
| `project_reference`             | string                                 |          | Project ID or slug that owns the schedule.                                                     |
| `name`                          | string · min length 1 · max length 255 | Yes      | Human-readable schedule name.                                                                  |
| `target`                        | object                                 | Yes      | Typed schedule target.                                                                         |
| `schedule`                      | string · min length 1 · max length 255 | Yes      | Schedule expression, for example a cron expression.                                            |
| `timezone`                      | string · min length 1 · max length 128 |          | IANA timezone used to evaluate the schedule. Defaults to UTC.                                  |
| `runtime_target_kind`           | string                                 |          | Runtime target kind for scheduled runs. One of `main_branch`, `environment`, `preview_branch`. |
| `runtime_target_environment_id` | string · uuid \| null                  |          | Environment ID when runtime\_target\_kind is environment.                                      |
| `runtime_target_branch_id`      | string · uuid \| null                  |          | Branch ID when runtime\_target\_kind is preview\_branch.                                       |
| `config`                        | object                                 |          | Run configuration. For agent schedules, put the run prompt in config.prompt.                   |
| `timeout_seconds`               | integer                                |          | Per-run timeout in seconds.                                                                    |
| `backoff_limit`                 | integer · min 0                        |          | Retry backoff limit for failed scheduled runs.                                                 |
| `concurrency_policy`            | string                                 |          | How overlapping scheduled runs are handled. One of `Allow`, `Forbid`, `Replace`.               |
| `max_runs`                      | integer \| null                        |          | Optional maximum number of scheduled runs.                                                     |

## 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_schedule",
    "arguments": {
      "name": "string",
      "target": {
        "kind": "task",
        "id": "string"
      },
      "schedule": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"id\":\"00000000-0000-0000-0000-000000000000\",\"project_id\":\"00000000-0000-0000-0000-000000000000\",\"name\":\"string\",\"status\":\"active\",\"paused_reason\":\"string\",\"paused_at\":\"string\",\"last_failure_at\":\"string\",\"last_failure_code\":\"string\",\"last_failure_message\":\"string\",\"last_failure_run_id\":\"00000000-0000-0000-0000-000000000000\",\"target\":{\"kind\":\"task\",\"id\":\"string\",\"conversation_mode\":\"create_new\",\"conversation_id\":\"00000000-0000-0000-0000-000000000000\"},\"schedule\":\"string\",\"timezone\":\"string\",\"runtime_target_kind\":\"main_branch\",\"runtime_target_environment_id\":\"00000000-0000-0000-0000-000000000000\",\"runtime_target_branch_id\":\"00000000-0000-0000-0000-000000000000\",\"config\":{},\"timeout_seconds\":0,\"backoff_limit\":0,\"concurrency_policy\":\"string\",\"definition_source\":\"manual\",\"source_trigger_id\":\"string\",\"source_path\":\"string\",\"source_hash\":\"string\",\"last_scheduled_at\":\"string\",\"last_successful_at\":\"string\",\"health\":{\"maxStalenessSeconds\":1},\"max_runs\":1,\"run_count\":0,\"completed_at\":\"string\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"integration_requirements\":[],\"created_at\":\"string\",\"updated_at\":\"string\"}"
      }
    ],
    "structuredContent": {
      "id": "00000000-0000-0000-0000-000000000000",
      "project_id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "status": "active",
      "paused_reason": "string",
      "paused_at": "string",
      "last_failure_at": "string",
      "last_failure_code": "string",
      "last_failure_message": "string",
      "last_failure_run_id": "00000000-0000-0000-0000-000000000000",
      "target": {
        "kind": "task",
        "id": "string",
        "conversation_mode": "create_new",
        "conversation_id": "00000000-0000-0000-0000-000000000000"
      },
      "schedule": "string",
      "timezone": "string",
      "runtime_target_kind": "main_branch",
      "runtime_target_environment_id": "00000000-0000-0000-0000-000000000000",
      "runtime_target_branch_id": "00000000-0000-0000-0000-000000000000",
      "config": {},
      "timeout_seconds": 0,
      "backoff_limit": 0,
      "concurrency_policy": "string",
      "definition_source": "manual",
      "source_trigger_id": "string",
      "source_path": "string",
      "source_hash": "string",
      "last_scheduled_at": "string",
      "last_successful_at": "string",
      "health": {
        "maxStalenessSeconds": 1
      },
      "max_runs": 1,
      "run_count": 0,
      "completed_at": "string",
      "created_by": "00000000-0000-0000-0000-000000000000",
      "integration_requirements": [],
      "created_at": "string",
      "updated_at": "string"
    }
  }
}
```
