Skip to main content
Glama

save_workflow

Store and reuse custom workflows for creating MCP servers. Save workflow steps, name, and description for efficient server setup and future replication.

Instructions

Save a creation workflow for reuse. Args: name: Workflow name description: Workflow description steps: list of workflow steps Returns: Confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes
nameYes
stepsYes

Implementation Reference

  • main.py:248-279 (handler)
    MCP tool handler for 'save_workflow'. Decorated with @mcp.tool(), extracts workflow_engine from the request context, calls its save_workflow method, and returns a success or error message.
    @mcp.tool() async def save_workflow( ctx: Context, name: str, description: str, steps: list[dict], ) -> str: """ Save a creation workflow for reuse. Args: name: Workflow name description: Workflow description steps: list of workflow steps Returns: Confirmation message """ try: workflow_engine = ctx.request_context.lifespan_context["workflow_engine"] workflow_id = await workflow_engine.save_workflow( name=name, description=description, steps=steps, ) return f"✅ Workflow '{name}' saved successfully (ID: {workflow_id})" except Exception as e: logger.error(f"Failed to save workflow: {e}") return f"❌ Error saving workflow: {str(e)}"
  • Helper method in WorkflowEngine class that implements the core save logic: generates ID, creates Workflow object, stores in memory dict, persists to JSON file on disk.
    async def save_workflow( self, name: str, description: str, steps: list[dict[str, Any]], ) -> str: """Save workflow with automatic ID generation.""" workflow_id = str(uuid4())[:8] # Convert step dictionaries to WorkflowStep objects workflow_steps = [WorkflowStep(**step) for step in steps] workflow = Workflow( name=name, description=description, steps=workflow_steps, ) # Save to memory and disk self.workflows[workflow_id] = workflow await self._persist_workflow(workflow_id, workflow) logger.info(f"Saved workflow: {name} ({workflow_id})") return workflow_id
  • main.py:248-248 (registration)
    The @mcp.tool() decorator registers the save_workflow function as an MCP tool.
    @mcp.tool()

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/angrysky56/mcp-creator-mcp'

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