Skip to main content
Glama

get-tickets-by-list

Retrieve Trello cards from a specific list by providing the list ID, with optional limit control for batch processing.

Input Schema

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

Implementation Reference

  • The handler function fetches cards (tickets) from a Trello list using the Trello API. It checks for API credentials, constructs the API URL with listId and optional limit, fetches the data, and returns the JSON stringified response or error.
    async ({ listId, limit }) => { try { if (!trelloApiKey || !trelloApiToken) { 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', trelloApiKey); url.searchParams.append('token', trelloApiToken); if (limit) { url.searchParams.append('limit', limit.toString()); } const response = await fetch(url.toString()); const data = await response.json(); if (!Array.isArray(data)) { return { content: [ { type: 'text', text: 'Failed to get tickets from list', }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting tickets from list: ${error}`, }, ], isError: true, }; } }
  • Zod schema defining input parameters: listId (required string, ID of the Trello list) and limit (optional number, max cards to return).
    { listId: z.string().describe('ID of the list to get tickets from'), limit: z.number().optional().describe('Maximum number of cards to return'), },
  • src/index.ts:642-704 (registration)
    MCP server tool registration call: server.tool('get-tickets-by-list', inputSchema, handlerFunction).
    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 (!trelloApiKey || !trelloApiToken) { 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', trelloApiKey); url.searchParams.append('token', trelloApiToken); if (limit) { url.searchParams.append('limit', limit.toString()); } const response = await fetch(url.toString()); const data = await response.json(); if (!Array.isArray(data)) { return { content: [ { type: 'text', text: 'Failed to get tickets from list', }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting tickets from list: ${error}`, }, ], isError: true, }; } } );

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/praveencs87/trello-mcp'

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