Skip to main content
Glama
onemarc

GitHub Actions MCP Server

by onemarc

get_workflow_usage

Retrieve detailed usage statistics for GitHub Actions workflows by providing the repository owner, repository name, and workflow ID. Useful for monitoring and optimizing workflow performance.

Instructions

Get usage statistics of a workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
workflowIdYesThe ID of the workflow or filename

Implementation Reference

  • The main ToolHandler function that extracts owner, repo, workflowId from args and calls the GitHub API to retrieve workflow usage statistics, returning the data or throwing a WorkflowError on failure.
    const handleGetWorkflowUsage: ToolHandler = async (args, octokit: Octokit) => {
      const { owner, repo, workflowId } = args;
      
      try {
        const response = await octokit.rest.actions.getWorkflowUsage({
          owner,
          repo,
          workflow_id: workflowId
        });
    
        return response.data;
      } catch (error: any) {
        throw new WorkflowError(`Failed to get workflow usage: ${error.message}`, error.response?.data);
      }
    };
  • The tool metadata definition including name, description, and input schema (owner, repo, workflowId as string or number).
    {
      name: "get_workflow_usage",
      description: "Get usage statistics of a workflow",
      inputSchema: {
        type: "object",
        properties: {
          owner: { type: "string", description: "Repository owner" },
          repo: { type: "string", description: "Repository name" },
          workflowId: { 
            oneOf: [
              { type: "string" },
              { type: "number" }
            ],
            description: "The ID of the workflow or filename"
          }
        },
        required: ["owner", "repo", "workflowId"]
      }
    },
  • Maps the tool name 'get_workflow_usage' to its handler function in the toolHandlers export.
    get_workflow_usage: handleGetWorkflowUsage,
  • src/tools/index.ts:6-6 (registration)
    Imports the handler function from its dedicated file.
    import handleGetWorkflowUsage from './get-workflow-usage.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. It states 'Get usage statistics' which implies a read-only operation, but does not specify aspects like authentication needs, rate limits, data format, or any side effects. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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, making it easy to parse and front-loaded with the core purpose. It is appropriately sized for the tool's complexity, earning full marks for conciseness.

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 tool's moderate complexity (3 parameters, no output schema, and no annotations), the description is incomplete. It lacks details on what 'usage statistics' entail, how results are returned, or any behavioral traits, making it insufficient for an agent to fully understand the tool's context and usage.

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, detailing all three parameters (owner, repo, workflowId) with clear types and requirements. The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or usage examples, so it meets the baseline for high schema coverage.

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 'Get usage statistics of a workflow' clearly states the action (Get) and resource (usage statistics of a workflow), making the purpose understandable. However, it does not differentiate from siblings like 'get_workflow' or 'get_workflow_run', which might retrieve different types of workflow data, so it lacks specificity in comparison.

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 such as 'get_workflow' or 'list_workflow_runs'. There is no mention of context, prerequisites, or exclusions, leaving the agent without direction on tool selection among similar siblings.

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/onemarc/github-actions-mcp-server'

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