get_draft
Retrieve draft snapshots for live workflows to inspect pending changes before they modify production pipelines. Check draft status and configuration.
Instructions
Get the draft snapshot for a live workflow. When you update a live workflow, changes go to a draft instead of modifying the live pipeline. Use this to inspect the current draft state. Returns hasDraft: true/false and the draft config if it exists.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The workflow ID |
Implementation Reference
- src/tools/workflows.ts:262-280 (handler)MCP tool registration and handler implementation for 'get_draft'. It uses the AgentledClient to fetch the draft data.
server.tool( 'get_draft', `Get the draft snapshot for a live workflow. When you update a live workflow, changes go to a draft instead of modifying the live pipeline. Use this to inspect the current draft state. Returns hasDraft: true/false and the draft config if it exists.`, { workflowId: z.string().describe('The workflow ID'), }, async ({ workflowId }, extra) => { const client = clientFactory(extra); const result = await client.getDraft(workflowId); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; } ); - src/client.ts:163-165 (helper)Actual implementation of the API call to fetch a workflow draft from the backend.
async getDraft(workflowId: string) { return this.request(`/workflows/${workflowId}/draft`); }