Skip to main content
Glama

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
NameRequiredDescriptionDefault
workflowIdYesThe workflow ID

Implementation Reference

  • 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),
                    }],
                };
            }
        );
  • Actual implementation of the API call to fetch a workflow draft from the backend.
    async getDraft(workflowId: string) {
        return this.request(`/workflows/${workflowId}/draft`);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Agentled/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server