asana_get_attachments_for_object
Retrieve file attachments linked to tasks, projects, or other objects in Asana to access supporting documents and resources.
Instructions
List attachments for an object (task, project, etc)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_gid | Yes | The object GID to get attachments for | |
| limit | No | Results per page (1-100) | |
| offset | No | Pagination offset token | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:526-532 (handler)The primary MCP tool handler switch case that destructures input parameters and delegates execution to the AsanaClientWrapper's getAttachmentsForObject method, returning the JSON-stringified response.case "asana_get_attachments_for_object": { const { object_gid, ...opts } = args; const response = await asanaClient.getAttachmentsForObject(object_gid, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- Core implementation in AsanaClientWrapper that calls the Asana SDK's AttachmentsApi.getAttachmentsForObject to fetch attachments for the given object GID.async getAttachmentsForObject(objectId: string, opts: any = {}) { const response = await this.attachments.getAttachmentsForObject(objectId, opts); return response.data; }
- src/tools/attachment-tools.ts:3-30 (schema)MCP Tool definition including name, description, and input schema specifying required object_gid and optional pagination/fields parameters.export const getAttachmentsForObjectTool: Tool = { name: "asana_get_attachments_for_object", description: "List attachments for an object (task, project, etc)", inputSchema: { type: "object", properties: { object_gid: { type: "string", description: "The object GID to get attachments for" }, limit: { type: "number", description: "Results per page (1-100)", minimum: 1, maximum: 100 }, offset: { type: "string", description: "Pagination offset token" }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["object_gid"] } };
- src/tool-handler.ts:99-102 (registration)Registration of the tool in the main tools array exported for MCP server, alongside related attachment tools.getUsersForWorkspaceTool, getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool
- src/utils/validation.ts:363-366 (schema)Input parameter validation ensuring object_gid is a valid Asana GID before tool execution.case 'asana_get_attachments_for_object': result = validateGid(params.object_gid, 'object_gid'); if (!result.valid) errors.push(...result.errors); break;