Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_add_followers_for_project

Add users as followers to an Asana project to keep them updated on progress and changes.

Instructions

Add followers to a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID to add followers to
followersYesArray of user GIDs to add as followers to the project
opt_fieldsNoComma-separated list of optional fields to include in the response

Implementation Reference

  • Core handler method in AsanaClientWrapper that adds followers to a project via Asana ProjectsApi or direct API call fallback.
    async addFollowersForProject(projectId: string, followers: any) {
      try {
        const followersArray = this.ensureArray(followers);
        const body = {
          data: {
            followers: followersArray
          }
        };
        const response = await this.projects.addFollowersForProject(body, projectId);
        return response.data;
      } catch (error: any) {
        console.error(`Error adding followers to project: ${error}`);
        
        // Adăugăm mai multe detalii despre eroare pentru debugging
        if (error.response && error.response.body) {
          console.error(`Response error details: ${JSON.stringify(error.response.body, null, 2)}`);
        }
        
        // Dacă metoda standard eșuează, încercăm metoda alternativă cu callApi direct
        try {
          const client = Asana.ApiClient.instance;
          const followersArray = this.ensureArray(followers);
          const response = await client.callApi(
            `/projects/${projectId}/addFollowers`,
            'POST',
            { project_gid: projectId },
            {},
            {},
            {},
            { data: { followers: followersArray } },
            ['token'],
            ['application/json'],
            ['application/json'],
            'Blob'
          );
          return response.data;
        } catch (fallbackError) {
          console.error("Error in fallback method for adding followers:", fallbackError);
          throw fallbackError;
        }
      }
    }
  • Dispatch handler in central tool_handler function that calls the AsanaClientWrapper method.
    case "asana_add_followers_for_project": {
      const { project_id, followers, ...opts } = args;
      const response = await asanaClient.addFollowersForProject(project_id, followers);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • MCP Tool definition including name, description, and inputSchema.
    export const addFollowersForProjectTool: Tool = {
      name: "asana_add_followers_for_project",
      description: "Add followers to a project",
      inputSchema: {
        type: "object",
        properties: {
          project_id: {
            type: "string",
            description: "The project ID to add followers to"
          },
          followers: {
            type: "array",
            items: {
              type: "string"
            },
            description: "Array of user GIDs to add as followers to the project"
          },
          opt_fields: {
            type: "string",
            description: "Comma-separated list of optional fields to include in the response"
          }
        },
        required: ["project_id", "followers"]
      }
    };
  • Tool registration in the exported tools array used for MCP server.
      addMembersForProjectTool,
      addFollowersForProjectTool,
      getUsersForWorkspaceTool,
      getAttachmentsForObjectTool,
      uploadAttachmentForObjectTool,
      downloadAttachmentTool
    ];
  • Input parameter validation ensuring project_id is valid GID and followers array is provided.
    case 'asana_add_members_for_project':
    case 'asana_add_followers_for_project':
      result = validateGid(params.project_id, 'project_id');
      if (!result.valid) errors.push(...result.errors);
      
      const arrayParam = toolName === 'asana_add_members_for_project' ? 'members' : 'followers';
      if (!params[arrayParam]) {
        errors.push(`${arrayParam} is required`);
      }
      break;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Add followers' implies a write/mutation operation, the description doesn't address permission requirements, whether this operation is idempotent, what happens if followers already exist, rate limits, or what the response contains. For a mutation tool with zero annotation coverage, this represents significant gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a straightforward operation and front-loads the essential information. Every word earns its place in this concise formulation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what constitutes a successful operation, what the response looks like, error conditions, or how this tool relates to similar operations in the sibling set. The 100% schema coverage helps with parameters, but the overall context for using this tool effectively is incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any meaningful semantic context beyond what's in the schema - it doesn't explain what 'followers' represent in Asana's context, how user GIDs should be obtained, or provide examples of valid opt_fields values. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add followers') and target resource ('to a project'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its sibling 'asana_add_followers_to_task' which performs a similar action on a different resource type, missing an opportunity for clear sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'asana_add_members_for_project' and 'asana_add_followers_to_task' available, there's no indication of when followers vs members should be added, or when to use this project-focused tool versus the task-focused follower tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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