AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { createAction, Property } from '@activepieces/pieces-framework';
import {
httpClient,
HttpRequest,
HttpMethod,
} from '@activepieces/pieces-common';
import { trelloCommon } from '../../common';
import { trelloAuth } from '../../..';
import { getCardAttachmentsActionOutputSchema } from '../../output-schemas';
export const getCardAttachments = createAction({
auth: trelloAuth,
name: 'get_card_attachments',
classification: 'SEARCH',
displayName: 'Get All Card Attachments',
description: 'Gets all attachments on a card.',
audience: 'human',
outputSchema: getCardAttachmentsActionOutputSchema,
aiMetadata: { description: 'Lists all attachments on a Trello card identified by card_id. Use to enumerate the files and links attached to a card, e.g. to find an attachment id before fetching or deleting it. Read-only and idempotent.', idempotent: true },
props: {
card_id: Property.ShortText({
description: "From an earlier step, or the code after /c/ in the card's URL.",
displayName: 'Card ID',
placeholder: 'aBcD1234',
required: true,
})
},
async run(context) {
const request: HttpRequest = {
method: HttpMethod.GET,
url:
`${trelloCommon.baseUrl}cards/${context.propsValue['card_id']}/attachments` +
`?key=` +
context.auth.username +
`&token=` +
context.auth.password,
headers: {
Accept: 'application/json',
},
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});