Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_teams_for_workspace

Retrieve teams within a specific Asana workspace to organize and manage team-based projects and tasks.

Instructions

Get teams in a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_gidNoThe workspace GID to get teams for (optional if DEFAULT_WORKSPACE_ID is set)
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

  • Core handler implementation: AsanaClientWrapper.getTeamsForWorkspace method that calls the Asana Teams API to fetch teams for the given workspace_gid (or default), with error handling.
    async getTeamsForWorkspace(workspace_gid: string | undefined, opts: any = {}) {
      try {
        // Use default workspace if not specified and available
        if (!workspace_gid && this.defaultWorkspaceId) {
          workspace_gid = this.defaultWorkspaceId;
        }
        
        if (!workspace_gid) {
          throw new Error("No workspace specified and no default workspace ID set");
        }
        
        const response = await this.teams.getTeamsForWorkspace(workspace_gid, opts);
        return response.data;
      } catch (error) {
        console.error(`Error in getTeamsForWorkspace: ${error}`);
        throw error;
      }
    }
  • Tool dispatch handler in tool_handler switch statement that extracts parameters and delegates to AsanaClientWrapper.getTeamsForWorkspace.
    case "asana_get_teams_for_workspace": {
      const { workspace_gid, ...opts } = args;
      const response = await asanaClient.getTeamsForWorkspace(workspace_gid || undefined, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Tool schema definition including name, description, and inputSchema for parameter validation.
    export const getTeamsForWorkspaceTool: Tool = {
      name: "asana_get_teams_for_workspace",
      description: "Get teams in a workspace",
      inputSchema: {
        type: "object",
        properties: {
          workspace_gid: {
            type: "string",
            description: "The workspace GID to get teams for (optional if DEFAULT_WORKSPACE_ID is set)"
          },
          opt_fields: {
            type: "string",
            description: "Comma-separated list of optional fields to include"
          }
        },
        required: []
      }
    };
  • Tool registration: getTeamsForWorkspaceTool is imported and included in the exported tools array used by MCP.
    export const tools: Tool[] = [
      listWorkspacesTool,
      searchProjectsTool,
      getProjectTool,
      getProjectTaskCountsTool,
      getProjectSectionsTool,
      createSectionForProjectTool,
      createProjectForWorkspaceTool,
      updateProjectTool,
      reorderSectionsTool,
      getProjectStatusTool,
      getProjectStatusesForProjectTool,
      createProjectStatusTool,
      deleteProjectStatusTool,
      searchTasksTool,
      getTaskTool,
      createTaskTool,
      updateTaskTool,
      createSubtaskTool,
      getMultipleTasksByGidTool,
      addTaskToSectionTool,
      getTasksForSectionTool,
      getProjectHierarchyTool,
      getSubtasksForTaskTool,
      getTasksForProjectTool,
      getTasksForTagTool,
      getTagsForWorkspaceTool,
      addTagsToTaskTool,
      addTaskDependenciesTool,
      addTaskDependentsTool,
      setParentForTaskTool,
      addFollowersToTaskTool,
      getStoriesForTaskTool,
      createTaskStoryTool,
      getTeamsForUserTool,
      getTeamsForWorkspaceTool,
      addMembersForProjectTool,
      addFollowersForProjectTool,
      getUsersForWorkspaceTool,
      getAttachmentsForObjectTool,
      uploadAttachmentForObjectTool,
      downloadAttachmentTool
    ];
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 but only states the basic action. It lacks details on permissions required, rate limits, pagination, error handling, or what the output looks like (e.g., list format, fields included). This is inadequate for a tool with potential complexity in API interactions.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

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?

Given no annotations, no output schema, and a read operation with potential behavioral nuances (e.g., authentication, data scope), the description is incomplete. It doesn't address return values, error cases, or usage constraints, leaving significant gaps for an AI agent to operate effectively.

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 parameters are documented in the schema. The description adds no additional meaning beyond implying workspace filtering, which is already covered. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 ('Get') and resource ('teams in a workspace'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'asana_get_teams_for_user' or 'asana_list_workspaces', which also retrieve workspace-related data, leaving some ambiguity about when to choose this specific tool.

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. It doesn't mention prerequisites (e.g., workspace access), exclusions, or compare to siblings like 'asana_get_teams_for_user' or 'asana_list_workspaces', leaving the agent to infer usage context without explicit direction.

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