asana_get_attachments_for_object
Retrieve file attachments and documents linked to any Asana object such as tasks or projects. Access uploaded files, images, and documents associated with work items.
Instructions
List attachments for an object (task, project, etc)
Input 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 |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"description": "Results per page (1-100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"object_gid": {
"description": "The object GID to get attachments for",
"type": "string"
},
"offset": {
"description": "Pagination offset token",
"type": "string"
},
"opt_fields": {
"description": "Comma-separated list of optional fields to include",
"type": "string"
}
},
"required": [
"object_gid"
],
"type": "object"
}
Implementation Reference
- src/tool-handler.ts:526-532 (handler)Tool handler switch case that destructures input parameters and calls AsanaClientWrapper.getAttachmentsForObject to execute the tool logic.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) }], }; }
- src/asana-client-wrapper.ts:1490-1493 (handler)Core implementation in AsanaClientWrapper that calls the Asana AttachmentsApi to retrieve 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)Tool schema definition including name, description, and input schema with required object_gid and optional pagination/fields.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:100-102 (registration)Registration of the tool in the main tools array exported by tool-handler.ts.getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool
- src/utils/validation.ts:363-366 (helper)Validation helper that checks if object_gid is a valid Asana GID.case 'asana_get_attachments_for_object': result = validateGid(params.object_gid, 'object_gid'); if (!result.valid) errors.push(...result.errors); break;