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

# Finalize

> Finalize the current run as completed with output, or failed with error.code and error.message, as REST POST /runs/{run_id}/finalize.

export const McpToolCall = ({tool, initialArguments = {}, requiresConfirmation = false}) => {
  const validateCall = function validateReferenceToolCall(token, text, requiresConfirmation, confirmed) {
    if (!token.trim()) return {
      error: "Paste a bearer token first."
    };
    let value;
    try {
      value = JSON.parse(text.trim() || "{}");
    } catch {
      return {
        error: "Arguments must be valid JSON."
      };
    }
    if (!value || typeof value !== "object" || Array.isArray(value)) return {
      error: "Arguments must be a JSON object."
    };
    if (requiresConfirmation && !confirmed) return {
      error: "Confirm the tool call before running it."
    };
    return {
      arguments: value
    };
  };
  const endpoint = "https://api.veryfront.com/mcp";
  const tokenStorageKey = 'veryfront.docs.mcpBearerToken';
  const escapeHtml = value => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  const highlightJson = value => {
    const escaped = escapeHtml(value);
    return escaped.replace(/("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)/g, match => {
      let color = '#f3f4f6';
      if (match.endsWith(':')) {
        color = '#7dd3fc';
      } else if (match.startsWith('"')) {
        color = '#86efac';
      } else if ((/true|false/).test(match)) {
        color = '#c4b5fd';
      } else if ((/null/).test(match)) {
        color = '#fcd34d';
      } else {
        color = '#67e8f9';
      }
      return `<span style="color: ${color}">${match}</span>`;
    });
  };
  const expandJsonStrings = value => {
    if (typeof value === 'string') {
      const trimmed = value.trim();
      if (trimmed.startsWith('{') && trimmed.endsWith('}') || trimmed.startsWith('[') && trimmed.endsWith(']')) {
        try {
          return expandJsonStrings(JSON.parse(trimmed));
        } catch {}
      }
      return value;
    }
    if (Array.isArray(value)) {
      return value.map(expandJsonStrings);
    }
    if (value && typeof value === 'object') {
      return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, expandJsonStrings(nestedValue)]));
    }
    return value;
  };
  const formatJson = value => {
    try {
      return JSON.stringify(expandJsonStrings(value), null, 2);
    } catch {
      return String(value);
    }
  };
  const formatResponseText = text => {
    const trimmed = text.trim();
    if (!trimmed) return 'No response body.';
    try {
      return formatJson(JSON.parse(trimmed));
    } catch {}
    const ssePayloads = trimmed.split(/\n\n+/).flatMap(chunk => chunk.split('\n').filter(line => line.startsWith('data:')).map(line => line.slice(5).trim()).filter(Boolean));
    for (let index = ssePayloads.length - 1; index >= 0; index -= 1) {
      try {
        return formatJson(JSON.parse(ssePayloads[index]));
      } catch {}
    }
    return trimmed;
  };
  const readStoredToken = () => {
    if (typeof window === 'undefined') return '';
    try {
      return window.sessionStorage.getItem(tokenStorageKey) || '';
    } catch {
      return '';
    }
  };
  const writeStoredToken = value => {
    if (typeof window === 'undefined') return;
    try {
      if (value) {
        window.sessionStorage.setItem(tokenStorageKey, value);
      } else {
        window.sessionStorage.removeItem(tokenStorageKey);
      }
    } catch {}
  };
  const [token, setToken] = useState(readStoredToken);
  const [argumentText, setArgumentText] = useState(formatJson(initialArguments));
  const [status, setStatus] = useState('Ready');
  const [response, setResponse] = useState('No response yet.');
  const [copied, setCopied] = useState(false);
  const [confirmed, setConfirmed] = useState(false);
  const callTool = async () => {
    const validation = validateCall(token, argumentText, requiresConfirmation, confirmed);
    if (('error' in validation)) {
      setStatus(validation.error);
      return;
    }
    const parsedArguments = validation.arguments;
    setConfirmed(false);
    const body = {
      jsonrpc: '2.0',
      id: Date.now(),
      method: 'tools/call',
      params: {
        name: tool,
        arguments: parsedArguments
      }
    };
    setStatus('Calling tool...');
    setResponse(formatJson(body));
    try {
      const result = await fetch(endpoint, {
        method: 'POST',
        headers: {
          accept: 'application/json, text/event-stream',
          'content-type': 'application/json',
          authorization: `Bearer ${token.trim()}`,
          'x-veryfront-origin': 'docs-mcp-tool-page'
        },
        body: JSON.stringify(body)
      });
      const text = await result.text();
      setStatus(result.ok ? 'Response received.' : `Request failed with HTTP ${result.status}.`);
      setResponse(formatResponseText(text));
    } catch (error) {
      setStatus('Request failed.');
      setResponse(error instanceof Error ? error.message : String(error));
    }
  };
  const copyResponse = async () => {
    try {
      await navigator.clipboard.writeText(response);
      setCopied(true);
      setTimeout(() => setCopied(false), 1500);
    } catch {
      setStatus('Copy failed.');
    }
  };
  return <details className="api-try-operation not-prose">
    <summary>Try this tool</summary>
    <p>Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.</p>
    <div className="api-request-playground not-prose my-6 rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-950">
      <div className="mb-4">
        <div className="text-sm font-semibold text-gray-900 dark:text-gray-100">MCP tool call</div>
        <div className="mt-1 text-sm text-gray-600 dark:text-gray-400">
          Call <code>{tool}</code> against the Veryfront MCP endpoint.
        </div>
      </div>

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-token`}>
        Bearer token or API key
      </label>
      <input id={`${tool}-token`} className="mb-4 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" type="password" value={token} onChange={event => {
    const value = event.target.value;
    setToken(value);
    setConfirmed(false);
    writeStoredToken(value);
  }} placeholder="Paste API key or JWT" />

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-arguments`}>
        Arguments (JSON)
      </label>
      <textarea id={`${tool}-arguments`} className="mb-4 min-h-40 w-full rounded-md border border-gray-300 bg-white px-3 py-2 font-mono text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" value={argumentText} onChange={event => {
    setArgumentText(event.target.value);
    setConfirmed(false);
  }} spellCheck={false} />

      {requiresConfirmation && <label className="api-request-confirmation mb-4 flex items-start gap-2 text-sm">
        <input type="checkbox" checked={confirmed} onChange={event => setConfirmed(event.target.checked)} />
        <span>{tool === 'veryfront__set_project_inference_policy' ? 'Replace the project inference policy with these arguments. Omitted constraints will be removed.' : 'Run this tool with these arguments.'}</span>
      </label>}
      <button disabled={status === 'Calling tool...' || requiresConfirmation && !confirmed} className="disabled:opacity-50 disabled:cursor-not-allowed rounded-md bg-gray-900 px-3 py-2 text-sm font-medium text-white hover:bg-gray-700 dark:bg-gray-100 dark:text-gray-950 dark:hover:bg-gray-300" type="button" onClick={callTool}>
        Run tool
      </button>

      <div className="mt-4 text-sm font-medium text-gray-900 dark:text-gray-100">{status}</div>
      <div className="mt-3 overflow-hidden rounded-md border border-gray-300 dark:border-gray-700">
        <div className="flex items-center justify-between bg-gray-100 px-3 py-2 text-sm font-medium text-gray-900 dark:bg-gray-900 dark:text-gray-100">
          <span>Output JSON</span>
          <button className="rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-900 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-100 dark:hover:bg-gray-800" type="button" onClick={copyResponse}>
            {copied ? 'Copied' : 'Copy'}
          </button>
        </div>
      <pre className="max-h-96 overflow-auto whitespace-pre-wrap break-words bg-gray-950 p-4 text-sm text-gray-100">
        <code dangerouslySetInnerHTML={{
    __html: highlightJson(response)
  }} />
      </pre>
      </div>
    </div>
    </details>;
};

<div className="api-operation-signature">
  `veryfront__finalize`
</div>

This ends execution: no further model turns or tools run.

Current-run and generation authority are required; no run id is accepted.

Already-terminal outcomes are preserved.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Can change resources.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `status` | `string` | Yes | Lifecycle status for the target record. Values: `"completed"`, `"failed"`. |
| `output` | `value` | No | Required for completed. The final run output. |
| `error` | `object` | No | Required for failed. |

## 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](/docs/cloud/getting-started/connect-mcp).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__finalize",
    "arguments": {
      "status": "completed"
    }
  }
}
```

## 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 |
| - | - | - | - |
| `completed` | `boolean` | Yes | |
| `run` | `object` | Yes | Structured run details associated with this tool result. |

## Full schemas

<CodeGroup>
  ```json title="input-schema.json" theme={null}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "enum": [
          "completed",
          "failed"
        ],
        "description": "Lifecycle status for the target record."
      },
      "output": {
        "description": "Required for completed. The final run output."
      },
      "error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Provide the code."
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "Provide the message."
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "description": "Any JSON value. The HTTP boundary rejects non-JSON values."
            },
            "description": "Provide the details."
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false,
        "description": "Required for failed."
      }
    },
    "required": [
      "status"
    ],
    "additionalProperties": false,
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "Arguments for the finalize tool."
  }
  ```

  ```json title="output-schema.json" theme={null}
  {
    "type": "object",
    "properties": {
      "completed": {
        "type": "boolean"
      },
      "run": {
        "type": "object",
        "properties": {
          "run_id": {
            "type": "string",
            "minLength": 1,
            "description": "Run identifier associated with this result."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Unique identifier for the returned record."
          },
          "kind": {
            "type": "string",
            "enum": [
              "agent",
              "workflow",
              "task",
              "eval"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "waiting",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "Lifecycle status for the returned record."
          },
          "owner": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "conversation",
                  "project"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "Unique identifier for the returned record."
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false,
            "description": "Structured owner details associated with this tool result."
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "Project identifier associated with this result."
              },
              {
                "type": "null",
                "description": "Project identifier associated with this result."
              }
            ],
            "description": "Project identifier associated with this result."
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "Conversation identifier associated with this result."
              },
              {
                "type": "null",
                "description": "Conversation identifier associated with this result."
              }
            ],
            "description": "Conversation identifier associated with this result."
          },
          "message_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null",
                "description": "The message id returned by the tool."
              }
            ]
          },
          "usage": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requests": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "model_calls": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null",
                        "description": "The model calls returned by the tool."
                      }
                    ]
                  },
                  "input_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "output_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "cache_creation_input_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "cache_read_input_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reasoning_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "cost_credits": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      {
                        "type": "null",
                        "description": "The cost credits returned by the tool."
                      }
                    ]
                  }
                },
                "required": [
                  "requests",
                  "model_calls",
                  "input_tokens",
                  "output_tokens",
                  "cache_creation_input_tokens",
                  "cache_read_input_tokens",
                  "reasoning_tokens",
                  "total_tokens",
                  "cost_credits"
                ],
                "additionalProperties": false,
                "description": "Structured usage details associated with this tool result."
              },
              {
                "type": "null",
                "description": "The usage returned by the tool."
              }
            ]
          },
          "tool_error_count": {
            "type": "integer",
            "minimum": 0
          },
          "children_failed": {
            "type": "boolean"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null",
                "description": "The parent run id returned by the tool."
              }
            ]
          },
          "root_run_id": {
            "type": "string",
            "minLength": 1
          },
          "waiting_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "tool",
                  "approval",
                  "event",
                  "input",
                  "child_run",
                  "manual_pause"
                ]
              },
              {
                "type": "null",
                "description": "The waiting reason returned by the tool."
              }
            ]
          },
          "waiting_on": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "run"
                    },
                    "run_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "pattern": "^[a-zA-Z0-9_-]+$",
                      "description": "Run identifier associated with this result."
                    },
                    "correlation": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "tool_call",
                            "workflow_node"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255,
                          "description": "Unique identifier for the returned record."
                        }
                      },
                      "required": [
                        "kind",
                        "id"
                      ],
                      "additionalProperties": false,
                      "description": "Structured correlation details associated with this tool result."
                    }
                  },
                  "required": [
                    "kind",
                    "run_id",
                    "correlation"
                  ],
                  "additionalProperties": false
                },
                "description": "List of waiting on associated with this tool result."
              },
              {
                "type": "null",
                "description": "The waiting on returned by the tool."
              }
            ]
          },
          "waiting": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "$ref": "#/properties/run/properties/waiting_reason/anyOf/0",
                    "description": "The reason returned by the tool."
                  },
                  "on": {
                    "type": "array",
                    "items": {
                      "$ref": "#/properties/run/properties/waiting_on/anyOf/0/items",
                      "description": "One on item returned by the tool."
                    },
                    "description": "List of on associated with this tool result."
                  },
                  "pending_approvals": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "maxItems": 100,
                    "description": "List of pending approvals associated with this tool result."
                  },
                  "resume_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null",
                        "description": "The resume at returned by the tool."
                      }
                    ]
                  }
                },
                "required": [
                  "reason",
                  "on",
                  "pending_approvals",
                  "resume_at"
                ],
                "additionalProperties": false,
                "description": "Structured waiting details associated with this tool result."
              },
              {
                "type": "null",
                "description": "The waiting returned by the tool."
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "description": "Additional structured metadata returned by the tool."
              },
              {
                "type": "null",
                "description": "Additional structured metadata returned by the tool."
              }
            ],
            "description": "Additional structured metadata returned by the tool."
          },
          "cancellation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requested_at": {
                    "type": "string"
                  },
                  "stopped_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "requested_at",
                  "stopped_at"
                ],
                "additionalProperties": false,
                "description": "Structured cancellation details associated with this tool result."
              },
              {
                "type": "null",
                "description": "The cancellation returned by the tool."
              }
            ]
          },
          "pause": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requested_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "requested_at"
                ],
                "additionalProperties": false,
                "description": "Structured pause details associated with this tool result."
              },
              {
                "type": "null",
                "description": "The pause returned by the tool."
              }
            ]
          },
          "control": {
            "type": "object",
            "properties": {
              "pause": {
                "type": "object",
                "properties": {
                  "requested_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "requested_at"
                ],
                "additionalProperties": false,
                "description": "When a pause was requested; control.waiting confirms when execution is paused."
              },
              "waiting": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "manual_pause"
                        ]
                      }
                    },
                    "required": [
                      "reason"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 1 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "tool_result"
                        ]
                      },
                      "tool_call_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "Tool call identifier associated with this result."
                      }
                    },
                    "required": [
                      "reason",
                      "tool_call_id"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 2 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "integration_connected"
                        ]
                      },
                      "integration": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      }
                    },
                    "required": [
                      "reason",
                      "integration"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 3 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "approval"
                        ]
                      },
                      "wait_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "node_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "minItems": 1,
                        "description": "List of node ids associated with this tool result."
                      }
                    },
                    "required": [
                      "reason",
                      "wait_id",
                      "node_ids"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 4 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "event"
                        ]
                      },
                      "wait_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "Human-readable name for the returned record."
                      }
                    },
                    "required": [
                      "reason",
                      "wait_id",
                      "name"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 5 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "input_request"
                        ]
                      },
                      "input_request_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "minItems": 1,
                        "description": "List of input request ids associated with this tool result."
                      }
                    },
                    "required": [
                      "reason",
                      "input_request_ids"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 6 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "child_run"
                        ]
                      },
                      "dependencies": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "run_id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Run identifier associated with this result."
                            },
                            "correlation": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "tool_call"
                                      ]
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128,
                                      "description": "Unique identifier for the returned record."
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false,
                                  "description": "Structured option 1 details associated with this tool result."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "workflow_node"
                                      ]
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128,
                                      "description": "Unique identifier for the returned record."
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false,
                                  "description": "Structured option 2 details associated with this tool result."
                                }
                              ]
                            }
                          },
                          "required": [
                            "run_id",
                            "correlation"
                          ],
                          "additionalProperties": false
                        },
                        "minItems": 1,
                        "description": "List of dependencies associated with this tool result."
                      }
                    },
                    "required": [
                      "reason",
                      "dependencies"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 7 details associated with this tool result."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "resume_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "timer"
                        ]
                      }
                    },
                    "required": [
                      "resume_at",
                      "reason"
                    ],
                    "additionalProperties": false,
                    "description": "Structured option 8 details associated with this tool result."
                  }
                ],
                "description": "The current durable wait, with only the fields required to satisfy that wait."
              }
            },
            "additionalProperties": false
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short human-readable title returned by the tool."
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          },
          "workflow_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "schedule_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null",
                "description": "The schedule id returned by the tool."
              }
            ]
          },
          "batch_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null",
                "description": "The batch id returned by the tool."
              }
            ]
          },
          "runtime_target_kind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "main_branch",
                  "environment",
                  "preview_branch"
                ],
                "description": "Provide the runtime target kind."
              },
              {
                "type": "null",
                "description": "The runtime target kind returned by the tool."
              }
            ],
            "description": "Provide the runtime target kind."
          },
          "runtime_target_environment_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null",
                "description": "The runtime target environment id returned by the tool."
              }
            ]
          },
          "runtime_target_branch_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null",
                "description": "The runtime target branch id returned by the tool."
              }
            ]
          },
          "input": {
            "anyOf": [
              {},
              {
                "type": "null",
                "description": "The input returned by the tool."
              }
            ]
          },
          "config": {
            "anyOf": [
              {},
              {
                "type": "null",
                "description": "The config returned by the tool."
              }
            ]
          },
          "output": {
            "anyOf": [
              {},
              {
                "type": "null",
                "description": "The output returned by the tool."
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": true,
                "description": "Error details returned by the tool."
              },
              {
                "type": "null",
                "description": "Error details returned by the tool."
              }
            ],
            "description": "Error details returned by the tool."
          },
          "logs": {
            "type": [
              "string",
              "null"
            ]
          },
          "artifacts": {
            "type": "array",
            "items": {},
            "description": "List of artifacts associated with this tool result."
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null",
                "description": "The duration ms returned by the tool."
              }
            ]
          },
          "exit_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null",
                "description": "The exit code returned by the tool."
              }
            ]
          },
          "start_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "timeout_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null",
                "description": "The timeout seconds returned by the tool."
              }
            ]
          },
          "backoff_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null",
                "description": "The backoff limit returned by the tool."
              }
            ]
          },
          "input_schema_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              {
                "type": "null",
                "description": "The input schema sha256 returned by the tool."
              }
            ]
          },
          "output_schema_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              {
                "type": "null",
                "description": "The output schema sha256 returned by the tool."
              }
            ]
          },
          "input_schema_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$"
              },
              {
                "type": "null",
                "description": "The input schema hash returned by the tool."
              }
            ]
          },
          "output_schema_hash": {
            "anyOf": [
              {
                "$ref": "#/properties/run/properties/input_schema_hash/anyOf/0",
                "description": "The output schema hash returned by the tool."
              },
              {
                "type": "null",
                "description": "The output schema hash returned by the tool."
              }
            ]
          },
          "trigger": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "schedule",
                      "webhook",
                      "api"
                    ]
                  },
                  "id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Unique identifier for the returned record."
                  },
                  "principal": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "system",
                          "user",
                          "api_key",
                          "service_account"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the returned record."
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ],
                    "additionalProperties": false,
                    "description": "Structured principal details associated with this tool result."
                  }
                },
                "required": [
                  "kind",
                  "id",
                  "principal"
                ],
                "additionalProperties": false,
                "description": "Structured trigger details associated with this tool result."
              },
              {
                "type": "null",
                "description": "The trigger returned by the tool."
              }
            ]
          },
          "trigger_kind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "manual",
                  "schedule",
                  "webhook",
                  "api"
                ]
              },
              {
                "type": "null",
                "description": "The trigger kind returned by the tool."
              }
            ]
          },
          "trigger_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger_principal_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "system",
                  "user",
                  "api_key",
                  "service_account"
                ]
              },
              {
                "type": "null",
                "description": "The trigger principal type returned by the tool."
              }
            ]
          },
          "trigger_principal_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "type": "null",
                "description": "The created by returned by the tool."
              }
            ]
          },
          "updated_at": {
            "type": "string",
            "description": "Last update timestamp in ISO 8601 format."
          },
          "created_at": {
            "type": "string",
            "description": "Creation timestamp in ISO 8601 format."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "run_id",
          "id",
          "kind",
          "status",
          "owner",
          "project_id",
          "conversation_id",
          "message_id",
          "usage",
          "tool_error_count",
          "children_failed",
          "parent_run_id",
          "root_run_id",
          "waiting_reason",
          "waiting_on",
          "waiting",
          "cancellation",
          "pause",
          "title",
          "target",
          "workflow_id",
          "schedule_id",
          "batch_id",
          "runtime_target_kind",
          "runtime_target_environment_id",
          "runtime_target_branch_id",
          "error",
          "logs",
          "artifacts",
          "duration_ms",
          "exit_code",
          "start_mode",
          "timeout_seconds",
          "backoff_limit",
          "input_schema_sha256",
          "output_schema_sha256",
          "input_schema_hash",
          "output_schema_hash",
          "trigger",
          "trigger_kind",
          "trigger_id",
          "created_by",
          "updated_at",
          "created_at",
          "started_at",
          "completed_at"
        ],
        "additionalProperties": false,
        "description": "Structured run details associated with this tool result."
      }
    },
    "required": [
      "completed",
      "run"
    ],
    "additionalProperties": false,
    "description": "Structured result returned by the finalize tool.",
    "$schema": "http://json-schema.org/draft-07/schema#"
  }
  ```
</CodeGroup>

<McpToolCall
  tool="veryfront__finalize"
  requiresConfirmation={true}
  initialArguments={{
"status": "completed"
}}
/>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.