Skip to main content
Glama

list_project_columns

Retrieve and display all columns from a GitHub project to organize tasks and track workflow progress.

Instructions

List columns for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe ID of the project
per_pageNoResults per page (max 100)
pageNoPage number of the results

Implementation Reference

  • The core handler function that implements the logic to list project columns by querying the GitHub API and parsing the response with Zod.
    export async function listProjectColumns(
      github_pat: string,
      project_id: number,
      options: {
        per_page?: number;
        page?: number;
      } = {}
    ): Promise<z.infer<typeof ProjectColumnSchema>[]> {
      const url = new URL(`https://api.github.com/projects/${project_id}/columns`);
      
      if (options.per_page) url.searchParams.append("per_page", options.per_page.toString());
      if (options.page) url.searchParams.append("page", options.page.toString());
      
      const response = await githubRequest(
        github_pat,
        url.toString(),
        {
          headers: {
            "Accept": "application/vnd.github.inertia-preview+json",
          },
        }
      );
      return z.array(ProjectColumnSchema).parse(response);
    }
  • Input schema definitions for the list_project_columns tool, including parameters for project_id, pagination, and the internal schema with github_pat.
    export const ListProjectColumnsSchema = z.object({
      project_id: z.number().describe("The ID of the project"),
      per_page: z.number().optional().describe("Results per page (max 100)"),
      page: z.number().optional().describe("Page number of the results"),
    });
    
    export const _ListProjectColumnsSchema = ListProjectColumnsSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • Output schema for individual project columns returned by the GitHub API.
    export const ProjectColumnSchema = z.object({
      id: z.number(),
      node_id: z.string(),
      url: z.string(),
      project_url: z.string(),
      cards_url: z.string(),
      name: z.string(),
      created_at: z.string(),
      updated_at: z.string(),
    });
  • src/index.ts:259-263 (registration)
    Tool registration in the MCP tools array, defining name, description, and input schema.
    {
      name: "list_project_columns",
      description: "List columns for a project",
      inputSchema: zodToJsonSchema(projects.ListProjectColumnsSchema),
    },
  • src/index.ts:703-710 (registration)
    Dispatcher case in the main request handler that parses arguments and calls the listProjectColumns implementation.
    case "list_project_columns": {
      const args = projects._ListProjectColumnsSchema.parse(params.arguments);
      const { github_pat, project_id, ...options } = args;
      const result = await projects.listProjectColumns(github_pat, project_id, options);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }

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

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