Skip to main content
Glama

archive-card

Archive Trello cards automatically by specifying the card ID. Simplifies project management by removing clutter and maintaining organized boards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYesID of the card to archive

Implementation Reference

  • The main handler function for the 'archive-card' MCP tool. It performs a PUT request to the Trello API endpoint /cards/{cardId} with body {closed: true} to archive the specified card, handles credentials check and errors, and returns the API response.
    async ({ cardId }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ closed: true, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving card: ${error}`, }, ], isError: true, }; } }
  • Zod input schema validation for the 'archive-card' tool, requiring a single 'cardId' string parameter.
    { cardId: z.string().describe('ID of the card to archive'), },
  • Direct registration of the 'archive-card' tool on the MCP server within the registerCardsTools function using server.tool(name, inputSchema, handler).
    server.tool( 'archive-card', { cardId: z.string().describe('ID of the card to archive'), }, async ({ cardId }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ closed: true, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving card: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:90-90 (registration)
    Top-level invocation of registerCardsTools in the main server setup, which registers the 'archive-card' tool among other cards tools.
    registerCardsTools(server, credentials);

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/adriangrahldev/advanced-trello-mcp-server'

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