delete_card
Remove a card from a GitHub project by specifying its unique identifier. Simplifies project management by enabling quick deletion of obsolete or unnecessary cards.
Instructions
Delete a card from a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes | The unique identifier of the card |
Implementation Reference
- operations/projects.ts:449-468 (handler)The core handler function that executes the delete_card tool by sending a DELETE request to the GitHub API endpoint for project cards.export async function deleteCard(cardId: number) { try { const url = `https://api.github.com/projects/columns/cards/${cardId}`; await githubRequest(url, { method: 'DELETE', headers: { 'Accept': 'application/vnd.github.inertia-preview+json' } }); return { success: true }; } catch (error) { if (error instanceof GitHubError) { throw error; } throw new GitHubError(`Failed to delete card: ${(error as Error).message}`, 500, { error: (error as Error).message }); } }
- operations/projects.ts:89-91 (schema)Zod schema defining the input parameters for the delete_card tool (card_id: number).export const DeleteCardSchema = z.object({ card_id: z.number().describe("The unique identifier of the card"), });
- index.ts:260-264 (registration)Tool registration in the ListTools response, defining name, description, and input schema for delete_card.{ name: "delete_card", description: "Delete a card from a project", inputSchema: zodToJsonSchema(projects.DeleteCardSchema), },
- index.ts:714-720 (handler)Dispatcher handler in CallToolRequestHandler that parses arguments and invokes the deleteCard function.case "delete_card": { const args = projects.DeleteCardSchema.parse(request.params.arguments); const result = await projects.deleteCard(args.card_id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }