Skip to main content
Glama
cristip73
by cristip73

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
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

Implementation Reference

  • 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; }
  • 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"] } };
  • Registration of the tool in the main tools array exported for MCP server, alongside related attachment tools.
    getUsersForWorkspaceTool, getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool
  • 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;

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