Skip to main content
Glama
agrath

Atlassian Trello MCP Server

trello_delete_card_attachment

Remove an attachment from a Trello card by providing the card ID and attachment ID.

Instructions

Delete an attachment from a Trello card.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoTrello API key (optional if TRELLO_API_KEY env var is set)
tokenNoTrello API token (optional if TRELLO_TOKEN env var is set)
cardIdYesID or URL of the card (e.g. "abc123" or "https://trello.com/c/abc123/1-title")
attachmentIdYesID of the attachment to delete

Implementation Reference

  • The main handler function that executes the delete card attachment logic. Extracts credentials, validates params, calls TrelloClient.deleteCardAttachment(), and returns the result.
    export async function handleTrelloDeleteCardAttachment(args: unknown) {
      try {
        const { credentials, params } = extractCredentials(args);
        const { cardId, attachmentId} = validateDeleteCardAttachment(params);
        const client = new TrelloClient(credentials);
    
        const response = await client.deleteCardAttachment(cardId, attachmentId);
    
        const result = {
          summary: `Deleted attachment ${attachmentId} from card ${cardId}`,
          cardId,
          attachmentId,
          rateLimit: response.rateLimit
        };
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof z.ZodError
          ? formatValidationError(error)
          : error instanceof Error
            ? error.message
            : 'Unknown error occurred';
    
        return {
          content: [
            {
              type: 'text' as const,
              text: `Error deleting attachment: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • Validation schema for the delete card attachment input using Zod. Validates cardId (Trello ID) and attachmentId (string).
    const validateDeleteCardAttachment = (args: unknown) => {
      const schema = z.object({
    
        cardId: trelloIdSchema,
        attachmentId: z.string().min(1, 'Attachment ID is required')
      });
    
      return schema.parse(args);
    };
  • Tool definition/registration object with name 'trello_delete_card_attachment', description, and inputSchema.
    export const trelloDeleteCardAttachmentTool: Tool = {
      name: 'trello_delete_card_attachment',
      description: 'Delete an attachment from a Trello card.',
      inputSchema: {
        type: 'object',
        properties: {
          apiKey: {
            type: 'string',
            description: 'Trello API key (optional if TRELLO_API_KEY env var is set)'
          },
          token: {
            type: 'string',
            description: 'Trello API token (optional if TRELLO_TOKEN env var is set)'
          },
          cardId: {
            type: 'string',
            description: 'ID or URL of the card (e.g. "abc123" or "https://trello.com/c/abc123/1-title")'
          },
          attachmentId: {
            type: 'string',
            description: 'ID of the attachment to delete'
          }
        },
        required: ['cardId', 'attachmentId']
      }
    };
  • TrelloClient method that makes the actual DELETE API request to /cards/{cardId}/attachments/{attachmentId}.
    async deleteCardAttachment(cardId: string, attachmentId: string): Promise<TrelloApiResponse<void>> {
      return this.makeRequest<void>(
        `/cards/${cardId}/attachments/${attachmentId}`,
        { method: 'DELETE' },
        `Delete attachment ${attachmentId} from card ${cardId}`
      );
    }
  • src/server.ts:110-120 (registration)
    Server registration: 'trello_delete_card_attachment' is listed in the WRITE_TOOL_NAMES set as a write tool.
    const WRITE_TOOL_NAMES = new Set([
      'create_card', 'update_card', 'move_card', 'trello_archive_card',
      'trello_add_comment', 'trello_create_list',
      'trello_create_label', 'trello_update_label', 'trello_delete_label',
      'trello_add_label_to_card', 'trello_remove_label_from_card',
      'trello_add_member_to_card', 'trello_remove_member_from_card',
      'trello_create_checklist', 'trello_update_checklist', 'trello_delete_checklist',
      'trello_update_checklist_field',
      'trello_create_check_item', 'trello_delete_check_item', 'trello_update_check_item',
      'trello_create_card_attachment', 'trello_delete_card_attachment'
    ]);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; the description only states the action without disclosing side effects, permanence, permissions, or error conditions. Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no redundant information, efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete operation with well-described parameters, the description is adequate but lacks behavioral context and usage guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear parameter descriptions; the description adds no additional parameter meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and the resource ('attachment from a Trello card'). It differentiates from siblings like trello_create_card_attachment and trello_get_card_attachment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives, no prerequisites or conditions for deletion stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/agrath/Trello-Desktop-MCP'

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