Skip to main content
Glama

archive-cards

Automate archiving of Trello cards by specifying their IDs, streamlining project management and reducing board clutter. Integrate with Advanced Trello MCP Server for efficient workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdsYesIDs of the cards to archive

Implementation Reference

  • The handler function for the 'archive-cards' tool. It takes an array of card IDs, checks credentials, and for each card, makes a PUT request to the Trello API to set 'closed: true', effectively archiving the cards. Returns the JSON results or error.
    try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const results = await Promise.all( cardIds.map(async (cardId) => { 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, }), } ); return await response.json(); }) ); return { content: [ { type: 'text', text: JSON.stringify(results), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving cards: ${error}`, }, ], isError: true, }; } }
  • Input schema for the 'archive-cards' tool using Zod: requires an array of string card IDs.
    { cardIds: z.array(z.string()).describe('IDs of the cards to archive'), },
  • The server.tool call that registers the 'archive-cards' tool, including its name, input schema, and inline handler function within registerCardsTools.
    'archive-cards', { cardIds: z.array(z.string()).describe('IDs of the cards to archive'), }, async ({ cardIds }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const results = await Promise.all( cardIds.map(async (cardId) => { 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, }), } ); return await response.json(); }) ); return { content: [ { type: 'text', text: JSON.stringify(results), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving cards: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:90-90 (registration)
    Invocation of registerCardsTools in the main index.ts, which registers the 'archive-cards' tool among others.
    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