Skip to main content
Glama

get_workflow

Retrieve a specific workflow by its unique ID using this tool, enabling efficient access to structured, multi-step task paths for precise execution and management.

Instructions

Get a specific workflow by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The main handler function that executes the 'get_workflow' tool logic. It validates input using GetWorkflowSchema, retrieves the workflow from storage using this.storage.get(), handles not found errors, and returns the workflow as JSON in the MCP response format.
    private async getWorkflow(args: unknown) { const parsed = GetWorkflowSchema.parse(args); const workflow = await this.storage.get(parsed.id); if (!workflow) { throw new Error(`Workflow not found: ${parsed.id}`); } return { content: [ { type: 'text', text: JSON.stringify({ success: true, workflow, }, null, 2), }, ], }; }
  • Zod schema for validating input to the get_workflow tool, requiring a single 'id' string parameter.
    const GetWorkflowSchema = z.object({ id: z.string(), });
  • src/index.ts:263-266 (registration)
    Registration of the 'get_workflow' tool in the MCP tools list returned by listTools, including name, description, and input schema.
    name: 'get_workflow', description: 'Get a specific workflow by ID', inputSchema: zodToJsonSchema(GetWorkflowSchema), },
  • Core storage helper method called by the handler to retrieve the workflow JSON file from disk and parse it.
    async get(id: string): Promise<Workflow | null> { try { const filePath = this.getWorkflowPath(id); const data = await fs.readFile(filePath, 'utf-8'); return JSON.parse(data) as Workflow; } catch (error) { if ((error as any).code === 'ENOENT') { return null; } throw error; } }
  • Helper method to construct the file path for a workflow by ID, used in storage.get().
    private getWorkflowPath(id: string): string { return path.join(this.workflowsDir, `${id}.json`);

Other Tools

Related Tools

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/FiveOhhWon/workflows-mcp'

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