Skip to main content
Glama
by cristip73

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

NameRequiredDescriptionDefault
object_gidYesThe object GID to get attachments for
limitNoResults per page (1-100)
offsetNoPagination offset token
opt_fieldsNoComma-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

  • 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) }], }; }
  • 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; }
  • 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"] } };
  • Registration of the tool in the main tools array exported by tool-handler.ts.
    getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool
  • 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;

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/cristip73/mcp-server-asana'

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