Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

list-workflows

Retrieve and display all workflow files from a GitHub repository to monitor automation processes, CI/CD pipelines, and scheduled tasks.

Instructions

List workflows in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
pageNoPage number
perPageNoItems per page
repoYesRepository name

Implementation Reference

  • Main handler function that executes the list-workflows tool by validating inputs with Zod schema and calling the GitHub Actions API to list repository workflows.
    export async function listWorkflows(args: unknown): Promise<any> {
      const { owner, repo, page, perPage } = ListWorkflowsSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().actions.listRepoWorkflows({
          owner,
          repo,
          page,
          per_page: perPage,
        });
    
        return {
          total_count: data.total_count,
          workflows: data.workflows.map((workflow) => ({
            id: workflow.id,
            name: workflow.name,
            path: workflow.path,
            state: workflow.state,
            created_at: workflow.created_at,
            updated_at: workflow.updated_at,
            url: workflow.html_url,
          })),
        };
      }, 'Failed to list workflows');
    }
  • Zod validation schema for list-workflows tool inputs, requiring owner and repo, with optional pagination parameters.
    export const ListWorkflowsSchema = OwnerRepoSchema.extend({
      page: z.number().int().optional(),
      perPage: z.number().int().optional(),
    });
  • src/server.ts:275-301 (registration)
    Tool registration in ListToolsRequestHandler, defining the tool name, description, and input schema for client discovery.
    {
      name: 'list-workflows',
      description: 'List workflows in a GitHub repository',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          page: {
            type: 'integer',
            description: 'Page number',
          },
          perPage: {
            type: 'integer',
            description: 'Items per page',
          },
        },
        required: ['owner', 'repo'],
        additionalProperties: false,
      },
    },
  • Switch case in CallToolRequestHandler that routes calls to the listWorkflows handler function.
    case 'list-workflows':
      result = await listWorkflows(parsedArgs);
      break;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'List workflows' implies a read-only operation, but it doesn't specify whether this requires authentication, what format the output takes, whether results are paginated (though schema suggests pagination), or any rate limits. For a tool with 4 parameters and no annotation coverage, this leaves significant behavioral questions unanswered.

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, clear sentence with zero wasted words. It's front-loaded with the essential information and doesn't include any unnecessary elaboration. This is an excellent example of conciseness for a straightforward listing operation.

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, no output schema, and multiple sibling tools, the description is insufficiently complete. It doesn't explain what a 'workflow' means in GitHub context, what information is returned, how results are structured, or how this differs from related workflow operations. For a tool in a rich GitHub API context with many alternatives, more contextual information would be helpful.

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 all parameters are documented in the schema itself. The description doesn't add any parameter-specific information beyond what's in the schema. It mentions 'GitHub repository' which aligns with the owner/repo parameters, but provides no additional context about parameter usage, relationships, or constraints. Baseline 3 is appropriate when schema does the documentation work.

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 'List workflows in a GitHub repository' clearly states the action (list) and resource (workflows in a GitHub repository), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'list-workflow-runs' or 'trigger-workflow', but the verb+resource combination is specific enough for basic understanding.

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. With siblings like 'list-workflow-runs' and 'trigger-workflow' available, there's no indication of when this listing function is appropriate versus those other workflow-related operations. The description only states what it does, not when it should be selected.

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/piyushgIITian/github-enterprice-mcp'

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