update-action
Update specified Trello comment actions by modifying their text content using the action ID and new text input. Streamline project management with precise edits.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actionId | Yes | ID of the action to update | |
| text | Yes | New text content for the comment action |
Implementation Reference
- src/tools/actions.ts:80-127 (handler)The main handler function that implements the logic for the 'update-action' tool. It performs a PUT request to the Trello API to update the text of a comment action, with credential validation and error handling.async ({ actionId, text }) => { 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/actions/${actionId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ text, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating action: ${error}`, }, ], isError: true, }; } }
- src/tools/actions.ts:76-79 (schema)Zod input schema defining parameters for the 'update-action' tool: actionId (string) and text (string).{ actionId: z.string().describe('ID of the action to update'), text: z.string().describe('New text content for the comment action'), },
- src/tools/actions.ts:74-128 (registration)Direct registration of the 'update-action' tool using server.tool() within the registerActionsTools function, including schema and handler.server.tool( 'update-action', { actionId: z.string().describe('ID of the action to update'), text: z.string().describe('New text content for the comment action'), }, async ({ actionId, text }) => { 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/actions/${actionId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ text, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating action: ${error}`, }, ], isError: true, }; } } );
- src/index.ts:92-92 (registration)Invocation of registerActionsTools in the main server setup, which registers the 'update-action' tool along with other actions tools.registerActionsTools(server, credentials);