Skip to main content
Glama
goto-software

plane-mcp-server

retrieve_label

Retrieve details of a label by specifying its project and label IDs.

Instructions

Retrieve a label by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesUUID of the project
label_idYesUUID of the label

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
created_atNo
updated_atNo
deleted_atNo
nameYes
descriptionNo
colorNo
sort_orderNo
external_sourceNo
external_idNo
created_byNo
updated_byNo
workspaceNo
projectNo
parentNo

Implementation Reference

  • Handler function that executes the 'retrieve_label' tool logic. Takes project_id and label_id, initializes a PlaneClient, and calls client.labels.retrieve() to fetch the label from the Plane API.
    @mcp.tool()
    def retrieve_label(project_id: str, label_id: str) -> Label:
        """
        Retrieve a label by ID.
    
        Args:
            project_id: UUID of the project
            label_id: UUID of the label
    
        Returns:
            Label object
        """
        client, workspace_slug = get_plane_client_context()
        return client.labels.retrieve(workspace_slug=workspace_slug, project_id=project_id, label_id=label_id)
  • Registration function that registers all label tools (including 'retrieve_label') with the FastMCP server using the @mcp.tool() decorator.
    def register_label_tools(mcp: FastMCP) -> None:
        """Register all label-related tools with the MCP server."""
    
        @mcp.tool()
        def list_labels(
            project_id: str,
            params: dict[str, Any] | None = None,
        ) -> list[Label]:
            """
            List all labels in a project.
    
            Args:
                project_id: UUID of the project
                params: Optional query parameters as a dictionary
    
            Returns:
                List of Label objects
            """
            client, workspace_slug = get_plane_client_context()
            response: PaginatedLabelResponse = client.labels.list(
                workspace_slug=workspace_slug, project_id=project_id, params=params
            )
            return response.results
    
        @mcp.tool()
        def create_label(
            project_id: str,
            name: str,
            color: str | None = None,
            description: str | None = None,
            parent: str | None = None,
            sort_order: float | None = None,
            external_source: str | None = None,
            external_id: str | None = None,
        ) -> Label:
            """
            Create a new label.
    
            Args:
                project_id: UUID of the project
                name: Label name
                color: Label color (hex color code)
                description: Label description
                parent: UUID of the parent label (for nested labels)
                sort_order: Sort order for the label
                external_source: External system source name
                external_id: External system identifier
    
            Returns:
                Created Label object
            """
            client, workspace_slug = get_plane_client_context()
    
            data = CreateLabel(
                name=name,
                color=color,
                description=description,
                parent=parent,
                sort_order=sort_order,
                external_source=external_source,
                external_id=external_id,
            )
    
            return client.labels.create(workspace_slug=workspace_slug, project_id=project_id, data=data)
    
        @mcp.tool()
        def retrieve_label(project_id: str, label_id: str) -> Label:
            """
            Retrieve a label by ID.
    
            Args:
                project_id: UUID of the project
                label_id: UUID of the label
    
            Returns:
                Label object
            """
            client, workspace_slug = get_plane_client_context()
            return client.labels.retrieve(workspace_slug=workspace_slug, project_id=project_id, label_id=label_id)
    
        @mcp.tool()
        def update_label(
            project_id: str,
            label_id: str,
            name: str | None = None,
            color: str | None = None,
            description: str | None = None,
            parent: str | None = None,
            sort_order: float | None = None,
            external_source: str | None = None,
            external_id: str | None = None,
        ) -> Label:
            """
            Update a label by ID.
    
            Args:
                project_id: UUID of the project
                label_id: UUID of the label
                name: Label name
                color: Label color (hex color code)
                description: Label description
                parent: UUID of the parent label (for nested labels)
                sort_order: Sort order for the label
                external_source: External system source name
                external_id: External system identifier
    
            Returns:
                Updated Label object
            """
            client, workspace_slug = get_plane_client_context()
    
            data = UpdateLabel(
                name=name,
                color=color,
                description=description,
                parent=parent,
                sort_order=sort_order,
                external_source=external_source,
                external_id=external_id,
            )
    
            return client.labels.update(
                workspace_slug=workspace_slug,
                project_id=project_id,
                label_id=label_id,
                data=data,
            )
    
        @mcp.tool()
        def delete_label(project_id: str, label_id: str) -> None:
            """
            Delete a label by ID.
    
            Args:
                project_id: UUID of the project
                label_id: UUID of the label
            """
            client, workspace_slug = get_plane_client_context()
            client.labels.delete(workspace_slug=workspace_slug, project_id=project_id, label_id=label_id)
  • Central registration function that calls register_label_tools(mcp) to register the 'retrieve_label' tool along with all other tools.
    def register_tools(mcp: FastMCP) -> None:
        """Register all tools with the MCP server."""
        register_project_tools(mcp)
        register_work_item_tools(mcp)
        register_work_item_activity_tools(mcp)
        register_work_item_comment_tools(mcp)
        register_work_item_link_tools(mcp)
        register_work_item_relation_tools(mcp)
        register_work_log_tools(mcp)
        register_cycle_tools(mcp)
        register_user_tools(mcp)
        register_module_tools(mcp)
        register_initiative_tools(mcp)
        register_intake_tools(mcp)
        register_label_tools(mcp)
        register_page_tools(mcp)
        register_work_item_property_tools(mcp)
        register_work_item_type_tools(mcp)
        register_state_tools(mcp)
        register_workspace_tools(mcp)
        register_epic_tools(mcp)
        register_milestone_tools(mcp)
  • Helper function that initializes and returns a PlaneClient instance with workspace context, used by the retrieve_label handler to make API calls.
    def get_plane_client_context() -> PlaneClientContext:
        """
        Initialize and return a PlaneClient instance with workspace context.
    
        Authentication is handled by the PlaneOAuthProvider, which supports:
        1. Environment variables (PLANE_API_KEY + PLANE_WORKSPACE_SLUG)
        2. HTTP headers (x-api-key + x-workspace-slug)
        3. OAuth access token
    
        Environment variables:
        - PLANE_INTERNAL_BASE_URL: Internal URL for Plane API (preferred for server-to-server calls)
        - PLANE_BASE_URL: Base URL for Plane API (fallback, default: https://api.plane.so)
    
        Returns:
            PlaneClientContext containing configured PlaneClient instance and workspace slug
    
        Raises:
            ConfigurationError: If access token is not available or workspace slug is missing
        """
        base_url = os.getenv("PLANE_INTERNAL_BASE_URL") or os.getenv("PLANE_BASE_URL", "https://api.plane.so")
        workspace_slug = os.getenv("PLANE_WORKSPACE_SLUG", "")
    
        api_key = os.getenv("PLANE_API_KEY", "")
        access_token = None
    
        # Get access token from the OAuth provider (which handles all auth methods)
        stored_access_token: AccessToken | None = get_access_token()
        if stored_access_token:
            # Determine authentication method to use appropriate PlaneClient constructor
            auth_method = stored_access_token.claims.get("auth_method", "oauth")
            token = stored_access_token.token
            workspace_slug = stored_access_token.claims.get("workspace_slug", "")
    
            # For API key auth methods, use api_key parameter; for OAuth, use access_token
            if auth_method in ("api_key_env", "api_key_header"):
                api_key = token
            else:
                access_token = token
    
        if access_token:
            client = PlaneClient(
                base_url=base_url,
                access_token=access_token,
            )
        else:
            client = PlaneClient(
                base_url=base_url,
                api_key=api_key,
            )
    
        return PlaneClientContext(
            client=client,
            workspace_slug=workspace_slug,
        )
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits such as permissions, error handling (e.g., what happens if label not found), or side effects. The return format is presumably covered by the output schema, but the description adds no 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, complete sentence with no wasted words. It is appropriately sized for a simple retrieval tool.

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

Completeness4/5

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

Given that an output schema exists, the minimal description is acceptable. However, adding a note about uniqueness or required permissions would improve completeness. Currently adequate.

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?

The input schema covers both parameters with descriptions ('UUID of the project' and 'UUID of the label'), so schema_coverage is 100%. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

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

Purpose5/5

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

The description 'Retrieve a label by ID' uses a specific verb ('Retrieve') and resource ('label'), clearly distinguishing it from sibling tools like create_label, delete_label, update_label, and list_labels.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives (e.g., list_labels for all labels). However, for a simple retrieval by ID, usage is implied and clear.

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/goto-software/plane-mcp-server'

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