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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The ID of the project | |
| per_page | No | Results per page (max 100) | |
| page | No | Page number of the results |
Implementation Reference
- src/operations/projects.ts:153-176 (handler)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); }
- src/operations/projects.ts:72-80 (schema)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"), });
- src/operations/projects.ts:22-31 (schema)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) }], }; }