Skip to main content
Glama

archive-list

Archive or unarchive Trello lists to manage board organization and workflow stages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the list to archive or unarchive
archivedYesWhether to archive (true) or unarchive (false) the list

Implementation Reference

  • The handler function that implements the core logic of the 'archive-list' tool by making a PUT request to the Trello API to set the closed (archived) state of a list.
    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/lists/${listId}/closed?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ value: archived, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving list: ${error}`, }, ], isError: true, }; } }
  • Zod input schema for the 'archive-list' tool defining parameters listId and archived.
    listId: z.string().describe('ID of the list to archive or unarchive'), archived: z.boolean().describe('Whether to archive (true) or unarchive (false) the list'), }, async ({ listId, archived }) => {
  • The server.tool call that registers the 'archive-list' tool with its schema and handler function.
    server.tool( 'archive-list', { listId: z.string().describe('ID of the list to archive or unarchive'), archived: z.boolean().describe('Whether to archive (true) or unarchive (false) the list'), }, async ({ listId, archived }) => { 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/lists/${listId}/closed?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ value: archived, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving list: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:89-89 (registration)
    Top-level call to registerListsTools in the main MCP server setup, which includes registration of the 'archive-list' tool.
    registerListsTools(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