Skip to main content
Glama

workflow_info

Read-only

Retrieve workflow details including input fields, recent runs, and creator information by providing the workflow ID.

Instructions

Get detailed information about a workflow (glif) including its input fields, recent runs, and creator info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the workflow (glif) to show details for

Implementation Reference

  • The main handler function for the 'workflow_info' tool. Parses arguments (id), calls getGlifDetails API, extracts input fields from nodes, builds a formatted text response with glif details and recent runs.
    export async function handler(request: ToolRequest): Promise<ToolResponse> {
      const args = parseToolArguments(request, schema);
      const { glif, recentRuns } = await getGlifDetails(args.id);
    
      // Extract input field names from glif data
      const inputFields =
        glif.data?.nodes
          ?.filter((node) => node.type.includes("input"))
          .map((node) => ({
            name: node.name,
            type: node.type,
            params: node.params,
          })) ?? [];
    
      const details = [
        `Name: ${glif.name}`,
        `Description: ${glif.description}`,
        `Created by: ${glif.user.name} (@${glif.user.username})`,
        `Created: ${new Date(glif.createdAt).toLocaleString()}`,
        `Runs: ${glif.completedSpellRunCount}`,
        `Average Duration: ${glif.averageDuration}ms`,
        `Likes: ${glif.likeCount}`,
        "",
        "Input Fields:",
        ...inputFields.map((field) => `- ${field.name} (${field.type})`),
        "",
        "Recent Runs:",
        ...recentRuns.map(
          (run) =>
            `Time: ${new Date(run.createdAt).toLocaleString()}
    Duration: ${run.totalDuration}ms
    Output: ${run.output || "No output"}
    By: ${run.user.name} (@${run.user.username})
    ${
      run.inputs
        ? Object.entries(run.inputs)
            .map(([key, value]) => `  Input "${key}": ${value}`)
            .join("\n")
        : "No inputs"
    }`
        ),
      ];
    
      return {
        content: [
          {
            type: "text",
            text: details.join("\n"),
          },
        ],
      };
    }
  • Zod schema for the 'workflow_info' tool: expects a single 'id' string parameter.
    export const schema = z.object({
      id: z.string(),
    });
  • Tool registration in the 'core' group: maps glifInfo.definition.name ('workflow_info') to the glifInfo module. Always enabled (returns true).
    export const TOOL_REGISTRY: ToolGroupConfig[] = [
      {
        name: "core",
        enabled: () => true,
        tools: {
          [glifInfo.definition.name]: glifInfo,
          [runGlif.definition.name]: runGlif,
        },
      },
  • General dispatch in setupToolHandlers: looks up tool by name in enabledTools and calls its handler. This is where 'workflow_info' gets invoked at runtime.
      // Handle all registered tools
      const enabledTools = getEnabledTools();
      const tool = enabledTools[request.params.name];
      if (tool) {
        return tool.handler(request);
      }
    
      throw new McpError(
        ErrorCode.MethodNotFound,
        `Unknown tool: ${request.params.name}`
      );
    });
  • The getGlifDetails API function that fetches glif details and recent runs from the Glif API. Called by the workflow_info handler.
    export async function getGlifDetails(id: string): Promise<{
      glif: Glif;
      recentRuns: GlifRun[];
    }> {
      logger.debug("getGlifDetails", { id });
    
      try {
        const [glifData, runsData] = await Promise.all([
          apiRequest<unknown>("/glifs", "get", {
            queryParams: { id },
            context: "getGlifDetails - glifs",
          }),
          apiRequest<unknown>("/runs", "get", {
            queryParams: { glifId: id },
            context: "getGlifDetails - runs",
          }),
        ]);
    
        const glifArray = validateWithSchema(
          z.array(GlifSchema),
          glifData,
          "getGlifDetails - glifs validation"
        );
        const glif = glifArray[0];
        if (!glif) {
          throw new Error("No glif found in response");
        }
    
        const recentRuns = validateWithSchema(
          z.array(GlifRunSchema),
          runsData,
          "getGlifDetails - runs validation"
        ).slice(0, 3);
    
        return { glif, recentRuns };
      } catch (error) {
        return handleApiError(error, "getGlifDetails");
      }
    }
Behavior4/5

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

Annotations already indicate read-only (readOnlyHint: true). The description adds valuable detail about the return content (input fields, recent runs, creator info), making behavior transparent beyond the annotation.

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?

Single sentence that is concise, front-loaded with the action, and contains no extraneous words.

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

Completeness5/5

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

Given the tool's simplicity (one parameter, no output schema), the description provides sufficient context—what the tool does and what it returns—making it complete.

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 covers the single parameter 'id' fully (100% coverage). The description does not add additional meaning about the parameter beyond the schema, leading to baseline score.

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 it retrieves detailed information about a specific workflow, including inputs, runs, and creator. It distinguishes from siblings like list_featured_workflows (list) and run_workflow (execute), but does not explicitly contrast with alternatives.

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?

No guidance on when to use this tool versus siblings such as search_workflows or my_workflows. The description only explains the tool's function without providing use-case context.

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/glifxyz/glif-mcp-server'

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