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';

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