Skip to main content
Glama
martin-1103
by martin-1103

list_flows

Retrieve and filter flows from your current project to manage API workflows, with options to show active flows only and control result pagination.

Instructions

List flows in the current project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderIdNoFilter by folder ID
activeOnlyNoShow only active flows
limitNoMaximum number of flows to return
offsetNoNumber of flows to skip

Implementation Reference

  • Main execution handler for list_flows tool. Retrieves project context, calls backend API to list flows with optional filters, formats results, and returns MCP response.
    export async function handleListFlows(args: any): Promise<McpToolResponse> {
      try {
        const { folderId, activeOnly, limit, offset } = args;
    
        const instances = await getInstances();
    
        // Get project ID from config
        const config = await instances.configManager.detectProjectConfig();
        const projectId = config?.project?.id;
        if (!projectId) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  error: 'Project ID not found in config'
                }, null, 2)
              }
            ]
          };
        }
        const projectResponse = await instances.backendClient.getProjectContext(projectId);
        if (!projectResponse.success || !projectResponse.data) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  error: 'Failed to get current project'
                }, null, 2)
              }
            ]
          };
        }
    
        // Get flows from API
        const flowsResponse = await instances.backendClient.getFlows({
          project_id: projectId,
          folder_id: folderId,
          is_active: activeOnly,
          limit: limit || 50,
          offset: offset || 0
        });
    
        if (!flowsResponse.success) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  error: flowsResponse.message || 'Failed to retrieve flows'
                }, null, 2)
              }
            ]
          };
        }
    
        // Format flows for display
        const flows = (flowsResponse.data || []).map((flow: any) => ({
          id: flow.id,
          name: flow.name,
          description: flow.description,
          folder_id: flow.folder_id,
          project_id: flow.project_id,
          is_active: flow.is_active,
          step_count: flow.flow_data?.steps?.length || 0,
          created_at: flow.created_at,
          updated_at: flow.updated_at
        }));
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                data: flows,
                total: flows.length,
                message: `Retrieved ${flows.length} flows`
              }, null, 2)
            }
          ]
        };
    
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: error.message || 'Unknown error occurred while listing flows'
              }, null, 2)
              }
            ]
          };
      }
    }
  • MCP tool definition including name, description, input schema (with optional filters: folderId, activeOnly, limit, offset), and handler reference.
    export const listFlowsTool: McpTool = {
      name: 'list_flows',
      description: 'List flows in the current project',
      inputSchema: {
        type: 'object',
        properties: {
          folderId: {
            type: 'string',
            description: 'Filter by folder ID'
          },
          activeOnly: {
            type: 'boolean',
            description: 'Show only active flows',
            default: true
          },
          limit: {
            type: 'number',
            description: 'Maximum number of flows to return',
            default: 50
          },
          offset: {
            type: 'number',
            description: 'Number of flows to skip',
            default: 0
          }
        }
      },
      handler: handleListFlows
    };
  • Tool handler registration in the central factory function createFlowToolHandlers(), dynamically importing and delegating to the handleListFlows implementation.
    'list_flows': async (args: any) => {
      const { handleListFlows } = await import('./flows/handlers/detailsHandler.js');
      return handleListFlows(args);
  • Includes listFlowsTool in the flowTools array, which is exported and used in ALL_TOOLS in src/tools/index.ts
    export const flowTools = [
      executeFlowTool,
      createFlowTool,
      getFlowDetailsTool,
      listFlowsTool,
      deleteFlowTool
  • Re-exports listFlowsTool from tools.ts for use in parent modules.
    export { flowTools, executeFlowTool, createFlowTool, getFlowDetailsTool, listFlowsTool, deleteFlowTool } from './tools.js';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It implies a read-only operation by using 'List', but doesn't specify whether this requires authentication, how results are ordered, if pagination is handled via 'limit' and 'offset', or what happens on errors. For a tool with 4 parameters and no annotation coverage, this leaves significant gaps in understanding its behavior.

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 that front-loads the core purpose without unnecessary words. It uses minimal space to convey the essential action and scope, making it easy to parse quickly. Every part of the sentence earns its place by specifying both the verb and the resource context.

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 the complexity of a listing tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'flow' is in this context, how results are structured, or behavioral aspects like default sorting or error handling. While the schema covers parameters well, the overall context for effective tool use by an AI agent remains underspecified.

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?

The input schema has 100% description coverage, providing clear documentation for all 4 parameters ('folderId', 'activeOnly', 'limit', 'offset'). The description adds no additional parameter semantics beyond implying filtering by 'current project', which isn't a parameter. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 ('List') and resource ('flows in the current project'), making the purpose immediately understandable. It distinguishes from siblings like 'get_flow_details' (which retrieves a specific flow) and 'list_folders' (which lists a different resource). However, it doesn't specify what constitutes a 'flow' or differentiate from 'list_endpoints' or 'list_environments' beyond the resource name.

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. It doesn't mention when to prefer 'list_flows' over 'get_flow_details' for specific flows, or how it relates to 'list_folders' for organizational context. There's no indication of prerequisites, such as needing an active project, or exclusions for when other tools might be more appropriate.

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

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/martin-1103/mcp2'

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