get_copilot_seat_assignments
Retrieve GitHub Copilot seat assignments for an organization, showing user lists with last activity dates, editor information, and plan types.
Instructions
Get Copilot seat assignments for an Organization (user list with last activity date, editor info, plan type)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | No | Organization name (defaults to GITHUB_ORG env var) | |
| force_refresh | No | Ignore cache and fetch fresh data |
Implementation Reference
- src/tools/seats.ts:5-28 (handler)The registration and handler implementation for the get_copilot_seat_assignments tool.
export function registerSeatsTool(server: McpServer, client: GitHubClient, defaultOrg: string) { server.tool( "get_copilot_seat_assignments", "Get Copilot seat assignments for an Organization (user list with last activity date, editor info, plan type)", { org: z.string().optional().describe("Organization name (defaults to GITHUB_ORG env var)"), force_refresh: z.boolean().optional().describe("Ignore cache and fetch fresh data"), }, async ({ org, force_refresh }) => { try { const o = org ?? defaultOrg; if (!o) { return { content: [{ type: "text", text: "Organization name is required. Set GITHUB_ORG or pass 'org' parameter." }], isError: true }; } const seats = await client.fetchSeats(o, force_refresh ?? false); return { content: [{ type: "text", text: JSON.stringify(seats, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); }