Skip to main content
Glama
agrath

Atlassian Trello MCP Server

trello_create_card_attachment

Attach a URL or upload a local file to a Trello card by providing the card ID and attachment source.

Instructions

Attach a URL or local file to a Trello card. Provide either a url (for link attachments) or filePath (for file uploads from the local filesystem).

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")
urlNoURL to attach as a link (e.g. "https://example.com/doc.pdf"). Cannot be used with filePath.
filePathNoAbsolute path to a local file to upload (e.g. "/home/user/report.pdf"). Cannot be used with url.
nameNoOptional display name for the attachment
mimeTypeNoOptional MIME type (e.g. "application/pdf", "image/png"). Auto-detected for file uploads if omitted.
setCoverNoIf true, set this attachment as the card cover image

Implementation Reference

  • TrelloClient.createCardAttachment method that handles both file upload (multipart/form-data) and URL attachment (JSON POST) to /cards/{cardId}/attachments.
    async createCardAttachment(cardId: string, data: {
      url?: string;
      filePath?: string;
      name?: string;
      mimeType?: string;
      setCover?: boolean;
    }): Promise<TrelloApiResponse<TrelloAttachment>> {
      if (data.filePath) {
        // File upload via multipart/form-data
        const fileBuffer = await readFile(data.filePath);
        const fileName = data.name || basename(data.filePath);
        const blob = new Blob([fileBuffer], { type: data.mimeType || 'application/octet-stream' });
    
        const formData = new FormData();
        formData.append('file', blob, fileName);
        if (data.name) formData.append('name', data.name);
        if (data.mimeType) formData.append('mimeType', data.mimeType);
        if (data.setCover !== undefined) formData.append('setCover', String(data.setCover));
    
        return this.makeRequest<TrelloAttachment>(
          `/cards/${cardId}/attachments`,
          {
            method: 'POST',
            body: formData as any
          },
          `Upload file attachment to card ${cardId}`
        );
      }
    
      // URL attachment via JSON body
      const body: Record<string, any> = {};
      if (data.url) body.url = data.url;
      if (data.name) body.name = data.name;
      if (data.mimeType) body.mimeType = data.mimeType;
      if (data.setCover !== undefined) body.setCover = data.setCover;
    
      return this.makeRequest<TrelloAttachment>(
        `/cards/${cardId}/attachments`,
        {
          method: 'POST',
          body: JSON.stringify(body)
        },
        `Create URL attachment on card ${cardId}`
      );
    }
Behavior3/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It mentions the two attachment modes and that filePath is for local files, but does not disclose authentication requirements (though apiKey and token are in schema), error handling for exclusive parameters, or side effects. It adds some context beyond the schema but not comprehensive.

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?

The description consists of two concise sentences that front-load the purpose. Every word contributes meaning, and there is no redundant or vague language. The structure efficiently conveys the tool's core function and parameter guidance.

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?

Given the complexity (8 parameters, no output schema), the description covers the main use case but lacks details on what happens on success, error conditions (e.g., providing both url and filePath), or the response format. For a tool with no output schema, some hint about the result would be helpful. Still, it provides adequate guidance for basic usage.

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

Parameters4/5

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

All parameters are described in the schema (100% coverage). The description adds value by clarifying the exclusivity of url and filePath and explaining their purposes (link attachments vs file uploads). This goes beyond the schema's individual field descriptions.

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 it attaches a URL or local file to a Trello card, using specific verbs and resource. It distinguishes between two exclusive modes (url vs filePath), making the purpose unambiguous. Among siblings, it is distinct from deletion or other card operations.

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

Usage Guidelines4/5

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

The description tells the agent when to use this tool (for attaching to a card) and provides a clear choice between two parameter combinations. It does not explicitly mention when not to use it or alternatives, but the context of sibling tools implies that this is for addition, not removal or modification.

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