Skip to main content
Glama

get_work_item_states

Retrieve all valid states for a specific work item type in Azure DevOps projects to ensure accurate status updates and workflow compliance.

Instructions

Get all possible states for a specific work item type to help with accurate status updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesThe name or ID of the project.
work_item_typeYesThe work item type to get states for (e.g., 'Bug', 'User Story', 'Task').

Implementation Reference

  • Core handler function that fetches the work item type from Azure DevOps API and extracts all possible states, including name, color, and category.
    def get_work_item_states(self, project, work_item_type):
        """
        Get all possible states for a specific work item type.
        """
        work_item_type_obj = self.work_item_tracking_client.get_work_item_type(
            project=project,
            type=work_item_type
        )
        
        # Extract states from the work item type definition
        states = []
        if hasattr(work_item_type_obj, 'states') and work_item_type_obj.states:
            states = [
                {
                    "name": state.name,
                    "color": getattr(state, 'color', None),
                    "category": getattr(state, 'category', None)
                }
                for state in work_item_type_obj.states
            ]
        
        return states
  • Input schema definition for the get_work_item_states tool, specifying required parameters: project and work_item_type.
    inputSchema={
        "type": "object",
        "properties": {
            "project": {
                "type": "string", 
                "description": "The name or ID of the project."
            },
            "work_item_type": {
                "type": "string", 
                "description": "The work item type to get states for (e.g., 'Bug', 'User Story', 'Task')."
            },
        },
        "required": ["project", "work_item_type"],
        "additionalProperties": False
    }
  • Tool registration in the self.tools list, including name, description, and schema. Exposed via list_tools() handler.
    types.Tool(
        name="get_work_item_states",
        description="Get all possible states for a specific work item type to help with accurate status updates.",
        inputSchema={
            "type": "object",
            "properties": {
                "project": {
                    "type": "string", 
                    "description": "The name or ID of the project."
                },
                "work_item_type": {
                    "type": "string", 
                    "description": "The work item type to get states for (e.g., 'Bug', 'User Story', 'Task')."
                },
            },
            "required": ["project", "work_item_type"],
            "additionalProperties": False
        }
    ),
  • Server-side dispatch handler that calls the client.get_work_item_states method with parsed arguments.
    elif name == "get_work_item_states":
        return self.client.get_work_item_states(**arguments)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns paginated results, or what the output format is (e.g., list of strings, structured objects). For a tool with no annotations, this leaves significant behavioral gaps.

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 that front-loads the core purpose ('Get all possible states for a specific work item type') and adds a helpful context phrase ('to help with accurate status updates'). There is no wasted verbiage, and it's appropriately sized for the tool's complexity.

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

Completeness3/5

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

Given no annotations and no output schema, the description is moderately complete but has gaps. It clarifies the tool's purpose and parameters are well-covered by the schema, but lacks details on behavioral aspects (e.g., authentication, output format) and doesn't fully guide usage relative to siblings. For a simple read tool with good schema coverage, it's adequate but not comprehensive.

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 schema description coverage is 100%, with both parameters ('project' and 'work_item_type') well-documented in the schema. The description adds minimal value beyond this, mentioning 'specific work item type' which aligns with the schema but doesn't provide additional context like examples beyond what's in the schema (e.g., 'Bug', 'User Story', 'Task' are already in the schema). Baseline 3 is appropriate as 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 verb ('Get') and resource ('all possible states for a specific work item type'), making the purpose understandable. It distinguishes from siblings like 'get_work_item_types' by focusing on states rather than types, but doesn't explicitly contrast with 'get_work_item_transitions' which might also involve states. The 'to help with accurate status updates' adds useful context but isn't essential for differentiation.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions it helps with 'accurate status updates,' which implies a context for updating work items, but doesn't specify prerequisites (e.g., needing project context) or compare to siblings like 'get_work_item_transitions' that might offer similar state-related information. Usage is implied rather than clearly defined.

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/xrmghost/mcp-azure-devops'

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