Skip to main content
Glama

set_polarion_token

Configure your Polarion access token to authenticate with the requirements management system after generating it in your browser.

Instructions

<purpose>Set Polarion access token after generating it in browser</purpose>

<when_to_use>
- After using open_polarion_login() and generating token manually
- When you have a valid Polarion token to configure
- When replacing an expired token
</when_to_use>

<workflow_position>
STEP 2: Use this after open_polarion_login() and manual token generation
NEXT: Use check_polarion_status() to verify token is working
THEN: Begin data exploration with get_polarion_projects()
</workflow_position>

<parameters>
- token: The bearer token generated from Polarion's user token page
</parameters>

<output>Confirmation of token storage and next steps</output>

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler decorated with @mcp.tool(). Defines input schema via type annotation (token: str) and implements logic by delegating to PolarionClient.set_token_manually(token). This serves as both handler and registration.
    @mcp.tool()
    def set_polarion_token(token: str) -> str:
        """
        <purpose>Set Polarion access token after generating it in browser</purpose>
        
        <when_to_use>
        - After using open_polarion_login() and generating token manually
        - When you have a valid Polarion token to configure
        - When replacing an expired token
        </when_to_use>
        
        <workflow_position>
        STEP 2: Use this after open_polarion_login() and manual token generation
        NEXT: Use check_polarion_status() to verify token is working
        THEN: Begin data exploration with get_polarion_projects()
        </workflow_position>
        
        <parameters>
        - token: The bearer token generated from Polarion's user token page
        </parameters>
        
        <output>Confirmation of token storage and next steps</output>
        """
        logger.info("Setting Polarion token manually")
        return polarion_client.set_token_manually(token)
  • Core helper method in PolarionClient class that stores the token in memory, persists it to 'polarion_token.json' file via save_token(), and returns formatted JSON response.
    def set_token_manually(self, token: str) -> str:
        """Set token manually (after user generates it in browser)"""
        try:
            self.token = token
            self.save_token(token)
            return json.dumps({
                "status": "success",
                "message": "Token set successfully. Please test it by fetching work items or projects.",
                "token_preview": f"{token[:10]}...{token[-10:]}"
            }, indent=2)
        except Exception as e:
            logger.error(f"Failed to set token: {e}")
            return json.dumps({
                "status": "error",
                "message": f"Failed to set token: {e}"
            }, indent=2)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's role in configuring/storing a token (implying a write operation), specifies prerequisites (manual token generation), and mentions output confirmation. However, it lacks details on error handling, token format validation, or storage persistence.

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 well-structured with clear tags (<purpose>, <when_to_use>, etc.), making it easy to parse. Each section is front-loaded and concise, with no redundant information. The bullet points and stepwise workflow enhance readability without unnecessary verbosity.

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

Completeness5/5

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

Given the tool's moderate complexity (1 parameter, no annotations, but with output schema), the description is complete. It covers purpose, usage guidelines, workflow context, parameter semantics, and output expectations. The presence of an output schema means the description doesn't need to detail return values, and it adequately addresses all other aspects for effective tool selection and invocation.

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

Parameters4/5

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

The schema description coverage is 0%, but the description compensates well by explaining the 'token' parameter in the <parameters> section as 'The bearer token generated from Polarion's user token page,' adding meaningful context beyond the schema's basic type definition. It clarifies the token's origin and type, though it doesn't specify format constraints like length or encoding.

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 explicitly states the purpose with a specific verb ('Set') and resource ('Polarion access token'), and distinguishes it from siblings by mentioning it's used after token generation from open_polarion_login(). The <purpose> tag clearly defines the action and context.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool (after open_polarion_login() and manual token generation, with a valid token) and when not to use it (implied: not for initial login or token generation). It also outlines workflow steps and alternatives like check_polarion_status() and get_polarion_projects() in the <workflow_position> section.

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/Sdunga1/MCP-Polarion'

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