Skip to main content
Glama

get-tickets-by-list

Retrieve Trello cards from a specific list to track tasks and manage project workflows efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the list to get tickets from
limitNoMaximum number of cards to return

Implementation Reference

  • Executes the tool logic by fetching cards (tickets) from the specified Trello list using the API endpoint /lists/{id}/cards, with optional limit parameter. Handles credentials check and errors.
    async ({ listId, limit }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/lists/${listId}/cards`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (limit) url.searchParams.append('limit', limit.toString()); const response = await fetch(url.toString()); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting tickets by list: ${error}`, }, ], isError: true, }; }
  • Zod schema defining the input parameters: required listId (string) and optional limit (number).
    { listId: z.string().describe('ID of the list to get tickets from'), limit: z.number().optional().describe('Maximum number of cards to return'), },
  • Registers the 'get-tickets-by-list' tool on the MCP server using server.tool(), including schema and handler.
    server.tool( 'get-tickets-by-list', { listId: z.string().describe('ID of the list to get tickets from'), limit: z.number().optional().describe('Maximum number of cards to return'), }, async ({ listId, limit }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/lists/${listId}/cards`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (limit) url.searchParams.append('limit', limit.toString()); const response = await fetch(url.toString()); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting tickets by list: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:90-90 (registration)
    Top-level call to register all cards-related tools, including 'get-tickets-by-list', on the main MCP server instance.
    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