github_apps_delete_installation
Delete a GitHub App installation for the authenticated app by providing the installation ID.
Instructions
Delete an installation for the authenticated app
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| installation_id | Yes | installation_id |
Implementation Reference
- src/tools/apps.ts:114-116 (handler)The handler function that executes the tool logic: sends a DELETE request to /app/installations/{installation_id} to delete a GitHub App installation.
handler: async (args: Record<string, any>) => { return githubRequest("DELETE", `/app/installations/${args.installation_id}`, undefined, undefined); }, - src/tools/apps.ts:111-113 (schema)Input schema defining that the tool requires an installation_id string parameter.
inputSchema: z.object({ installation_id: z.string().describe("installation_id") }), - src/tools/apps.ts:108-117 (registration)The tool is defined as an entry in the appsTools array in src/tools/apps.ts. It is re-exported via src/tools/index.ts and registered with the MCP server in src/index.ts.
{ name: "github_apps_delete_installation", description: "Delete an installation for the authenticated app", inputSchema: z.object({ installation_id: z.string().describe("installation_id") }), handler: async (args: Record<string, any>) => { return githubRequest("DELETE", `/app/installations/${args.installation_id}`, undefined, undefined); }, }, - src/client.ts:9-59 (helper)The githubRequest helper function used by the handler to make authenticated HTTP requests to the GitHub API.
export async function githubRequest<T>( method: string, path: string, body?: Record<string, unknown>, params?: Record<string, string | number | boolean | string[] | undefined> ): Promise<T> { const url = new URL(`${BASE_URL}${path}`); if (params) { for (const [key, value] of Object.entries(params)) { if (value === undefined || value === null || value === "") continue; if (Array.isArray(value)) { url.searchParams.set(key, value.join(",")); } else { url.searchParams.set(key, String(value)); } } } const headers: Record<string, string> = { Authorization: `Bearer ${getToken()}`, Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", "User-Agent": "github-mcp/1.0.0", }; if (body) { headers["Content-Type"] = "application/json"; } const res = await fetch(url.toString(), { method, headers, body: body ? JSON.stringify(body) : undefined, }); if (!res.ok) { const text = await res.text().catch(() => ""); let detail = text; try { const json = JSON.parse(text); detail = json.message || text; if (json.errors) detail += ` -- ${JSON.stringify(json.errors)}`; } catch {} throw new Error(`GitHub API error ${res.status}: ${detail}`); } if (res.status === 204) return {} as T; return res.json() as Promise<T>; }