Skip to main content
Glama

create_streaming_workflow

Design and enable real-time streaming workflows by configuring agents and specifying workflow details using the AutoGen MCP Server's multi-agent conversation framework.

Instructions

Create a workflow with real-time streaming

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentsYesList of agent configurations
streamingNoEnable streaming
workflow_nameYesName for the workflow
workflow_typeYesType of workflow

Implementation Reference

  • Handler function for streaming tools including 'create_streaming_workflow'. Manages progress notifications, calls Python subprocess for core logic, and sends SSE streaming updates.
    private async handleStreamingTool(toolName: string, args: any, progressToken?: string): Promise<any> {
      if (progressToken) {
        await this.sendProgressNotification(progressToken, 25, 'Initializing streaming...');
      }
    
      const result = await this.callPythonHandler(toolName, args);
    
      if (args.streaming && this.sseTransports.size > 0) {
        for (const transport of this.sseTransports.values()) {
          try {
            await transport.send({
              jsonrpc: '2.0',
              method: 'notifications/progress',
              params: {
                progressToken: progressToken || 'streaming',
                progress: 75,
                message: 'Streaming updates...',
                data: result,
              },
            });
          } catch (error) {
            console.error('Error sending streaming update:', error);
          }
        }
      }
    
      if (progressToken) {
        await this.sendProgressNotification(progressToken, 100, 'Streaming completed');
      }
    
      return result;
  • Input schema and description for the 'create_streaming_workflow' tool, registered in ListToolsRequestSchema response.
    {
      name: 'create_streaming_workflow',
      description: 'Create a workflow with real-time streaming and progress updates',
      inputSchema: {
        type: 'object',
        properties: {
          workflow_name: { type: 'string', description: 'Name for the workflow' },
          workflow_type: { type: 'string', description: 'Type of workflow' },
          agents: { type: 'array', description: 'List of agent configurations' },
          streaming: { type: 'boolean', description: 'Enable streaming' },
          progress_token: { type: 'string', description: 'Progress token' },
        },
        required: ['workflow_name', 'workflow_type', 'agents'],
      },
  • Registration of the tool in the MCP server's ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'create_streaming_workflow',
          description: 'Create a workflow with real-time streaming and progress updates',
          inputSchema: {
            type: 'object',
            properties: {
              workflow_name: { type: 'string', description: 'Name for the workflow' },
              workflow_type: { type: 'string', description: 'Type of workflow' },
              agents: { type: 'array', description: 'List of agent configurations' },
              streaming: { type: 'boolean', description: 'Enable streaming' },
              progress_token: { type: 'string', description: 'Progress token' },
            },
            required: ['workflow_name', 'workflow_type', 'agents'],
          },
        },
        {
          name: 'start_streaming_chat',
          description: 'Start a streaming chat session with real-time updates',
          inputSchema: {
            type: 'object',
            properties: {
              agent_name: { type: 'string', description: 'Name of the agent to chat with' },
              message: { type: 'string', description: 'Initial message' },
              streaming: { type: 'boolean', description: 'Enable real-time streaming' },
              progress_token: { type: 'string', description: 'Token for progress notifications' },
            },
            required: ['agent_name', 'message'],
          },
        },
        {
          name: 'create_agent',
          description: 'Create a new AutoGen agent with enhanced capabilities',
          inputSchema: {
            type: 'object',
            properties: {
              name: { type: 'string', description: 'Unique name for the agent' },
              type: { type: 'string', description: 'Agent type' },
              system_message: { type: 'string', description: 'System message' },
              llm_config: { type: 'object', description: 'LLM configuration' },
            },
            required: ['name', 'type'],
          },
        },
        {
          name: 'execute_workflow',
          description: 'Execute a workflow with streaming support',
          inputSchema: {
            type: 'object',
            properties: {
              workflow_name: { type: 'string', description: 'Workflow name' },
              input_data: { type: 'object', description: 'Input data' },
              streaming: { type: 'boolean', description: 'Enable streaming' },
            },
            required: ['workflow_name', 'input_data'],
          },
        },
      ],
    }));
  • Dispatch logic in CallToolRequestSchema handler that routes 'create_streaming_workflow' to the streaming handler.
    if (toolName === 'create_streaming_workflow' || toolName === 'start_streaming_chat') {
      return await this.handleStreamingTool(toolName, args, progressToken);
    }
  • Helper function called by the handler to execute the toolName ('create_streaming_workflow') via spawning Python server.py process.
    private async callPythonHandler(toolName: string, args: any = {}): Promise<any> {
      const scriptPath = join(__dirname, 'autogen_mcp', 'server.py');
      const pythonArgs = [scriptPath, toolName, JSON.stringify(args)];
    
      return new Promise((resolve, reject) => {
        const process = spawn(this.pythonPath, pythonArgs);
        let stdout = '';
        let stderr = '';
    
        process.stdout.on('data', (data) => {
          stdout += data.toString();
        });
    
        process.stderr.on('data', (data) => {
          stderr += data.toString();
        });
    
        process.on('close', (code) => {
          if (code !== 0) {
            reject(new McpError(ErrorCode.InternalError, stderr || 'Python process failed'));
            return;
          }
    
          try {
            const result = JSON.parse(stdout);
            resolve(result);
          } catch (error) {
            reject(new McpError(ErrorCode.InternalError, 'Invalid JSON response from Python'));
          }
        });
    
        process.on('error', (error) => {
          reject(new McpError(ErrorCode.InternalError, error.message));
        });
      });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Create' which implies a write/mutation operation but doesn't disclose behavioral traits such as permissions needed, whether the workflow is immediately active, error handling, or rate limits. The mention of 'real-time streaming' hints at ongoing behavior but lacks specifics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core purpose ('Create a workflow') and adds a distinguishing feature ('with real-time streaming') concisely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that creates workflows with streaming. It doesn't cover what the tool returns, error conditions, or the implications of 'real-time streaming' in practice. For a mutation tool with multiple parameters, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond implying that 'streaming' is a key feature, but it doesn't explain parameter interactions, defaults, or usage examples. Baseline 3 is appropriate as the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('workflow') with a distinguishing feature ('with real-time streaming'). It differentiates from siblings like 'create_agent' and 'execute_workflow' by focusing on workflow creation with streaming capabilities, though it doesn't explicitly contrast with 'start_streaming_chat'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create_agent' or 'execute_workflow'. It mentions 'real-time streaming' but doesn't specify prerequisites, exclusions, or contextual scenarios for choosing this tool over others.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/DynamicEndpoints/Autogen_MCP'

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