Skip to main content
Glama
devrev

DevRev MCP Server

Official
by devrev

list_parts

Retrieve all enhancements in DevRev with filters for owners, dates, accounts, and sorting options to manage product improvements.

Instructions

List all parts (enhancements) in DevRev

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesThe type of parts to list
cursorNoThe cursor to use for pagination. If not provided, iteration begins from the first page. In the output you get next_cursor, use it and the correct mode to get the next or previous page. You can use these to loop through all the pages.
owned_byNoThe DevRev IDs of the users assigned to the parts to list
parent_partNoThe DevRev IDs of the parent parts to of the parts to list
created_byNoThe DevRev IDs of the users who created the parts to list
modified_byNoThe DevRev IDs of the users who modified the parts to list
sort_byNoThe field (and the order) to sort the parts by, in the sequence of the array elements
accountsNoThe account IDs of the accounts filter on parts to list
target_close_dateNo
target_start_dateNo
actual_close_dateNo
actual_start_dateNo

Implementation Reference

  • The handler logic for executing the 'list_parts' tool. It parses arguments, builds a payload for the DevRev API 'parts.list' endpoint, makes the request using make_devrev_request, and returns the results or error.
    elif name == "list_parts":
        if not arguments:
            raise ValueError("Missing arguments")
    
        payload = {}
        payload["enhancement"] = {}
    
        type = arguments.get("type")
        if not type:
            raise ValueError("Missing type parameter")
        payload["type"] = type
        
        cursor = arguments.get("cursor")
        if cursor:
            payload["cursor"] = cursor["next_cursor"]
            payload["mode"] = cursor["mode"]
        
        owned_by = arguments.get("owned_by")
        if owned_by:
            payload["owned_by"] = owned_by
        
        parent_part = arguments.get("parent_part")
        if parent_part:
            payload["parent_part"] = {"parts": parent_part}
        
        created_by = arguments.get("created_by")
        if created_by:
            payload["created_by"] = created_by
        
        modified_by = arguments.get("modified_by")
        if modified_by:
            payload["modified_by"] = modified_by
        
        sort_by = arguments.get("sort_by")
        if sort_by:
            payload["sort_by"] = sort_by
        
        accounts = arguments.get("accounts")
        if accounts:
            if 'enhancement' in type:
                payload["enhancement"]["accounts"] = accounts
        
        target_close_date = arguments.get("target_close_date")
        if target_close_date:
            if 'enhancement' in type:
                payload["enhancement"]["target_close_date"] = {"after": target_close_date["after"], "before": target_close_date["before"]}
        
        target_start_date = arguments.get("target_start_date")
        if target_start_date:
            if 'enhancement' in type:
                payload["enhancement"]["target_start_date"] = {"after": target_start_date["after"], "before": target_start_date["before"]}
    
        actual_close_date = arguments.get("actual_close_date")
        if actual_close_date:
            if 'enhancement' in type:
                payload["enhancement"]["actual_close_date"] = {"after": actual_close_date["after"], "before": actual_close_date["before"]}
        
        actual_start_date = arguments.get("actual_start_date")
        if actual_start_date:
            if 'enhancement' in type:
                payload["enhancement"]["actual_start_date"] = {"after": actual_start_date["after"], "before": actual_start_date["before"]}
    
        if payload["enhancement"] == {}:
            payload.pop("enhancement")
    
        response = make_devrev_request(
            "parts.list",
            payload
        )
        
        if response.status_code != 200:
            error_text = response.text
            return [
                types.TextContent(
                    type="text",
                    text=f"List parts failed with status {response.status_code}: {error_text}"
                )
            ]
        
        return [
            types.TextContent(
                type="text",
                text=f"Parts listed successfully: {response.json()}"
            )
        ]
  • The registration of the 'list_parts' tool in the list_tools handler, including its name, description, and detailed input schema for parameters like type, cursor, filters, and date ranges.
    types.Tool(
        name="list_parts",
        description="List all parts (enhancements) in DevRev",
        inputSchema={
            "type": "object",
            "properties": {
                "type": {"type": "string", "enum": ["enhancement"], "description": "The type of parts to list"},
                "cursor": {
                    "type": "object",
                    "properties": {
                        "next_cursor": {"type": "string", "description": "The cursor to use for pagination. If not provided, iteration begins from the first page."},
                        "mode": {"type": "string", "enum": ["after", "before"], "description": "The mode to iterate after the cursor or before the cursor ."},
                    },
                    "required": ["next_cursor", "mode"],
                    "description": "The cursor to use for pagination. If not provided, iteration begins from the first page. In the output you get next_cursor, use it and the correct mode to get the next or previous page. You can use these to loop through all the pages."
                },
                "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users assigned to the parts to list"},
                "parent_part": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the parent parts to of the parts to list"},
                "created_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who created the parts to list"},
                "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who modified the parts to list"},
                "sort_by": {"type": "array", "items": {"type": "string", "enum": ["target_close_date:asc", "target_close_date:desc", "target_start_date:asc", "target_start_date:desc", "actual_close_date:asc", "actual_close_date:desc", "actual_start_date:asc", "actual_start_date:desc", "created_date:asc", "created_date:desc", "modified_date:asc", "modified_date:desc"]}, "description": "The field (and the order) to sort the parts by, in the sequence of the array elements"},
                "accounts": {"type": "array", "items": {"type": "string"}, "description": "The account IDs of the accounts filter on parts to list"},
                "target_close_date": {
                    "type": "object",
                    "properties": {
                        "after": {"type": "string", "description": "The start date of the target close date range, for example: 2025-06-03T00:00:00Z"},
                        "before": {"type": "string", "description": "The end date of the target close date range, for example: 2025-06-03T00:00:00Z"},
                    }, 
                    "required": ["after", "before"]
                },
                "target_start_date": {
                    "type": "object",
                    "properties": {
                        "after": {"type": "string", "description": "The start date of the target start date range, for example: 2025-06-03T00:00:00Z"},
                        "before": {"type": "string", "description": "The end date of the target start date range, for example: 2025-06-03T00:00:00Z"},
                    }, 
                    "required": ["after", "before"]
                },
                "actual_close_date": {
                    "type": "object",
                    "properties": {
                        "after": {"type": "string", "description": "The start date of the actual close date range, for example: 2025-06-03T00:00:00Z"},
                        "before": {"type": "string", "description": "The end date of the actual close date range, for example: 2025-06-03T00:00:00Z"},
                    }, 
                    "required": ["after", "before"]
                },
                "actual_start_date": {
                    "type": "object",
                    "properties": {
                        "after": {"type": "string", "description": "The start date of the actual start date range, for example: 2025-06-03T00:00:00Z"},
                        "before": {"type": "string", "description": "The end date of the actual start date range, for example: 2025-06-03T00:00:00Z"},
                    }, 
                    "required": ["after", "before"]
                },
            },
            "required": ["type"],
        },
    ),
  • Utility function make_devrev_request used by the list_parts handler to send POST requests to DevRev API endpoints with authentication.
    def make_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Response:
        """
        Make an authenticated request to the DevRev API.
        
        Args:
            endpoint: The API endpoint path (e.g., "works.get" or "search.hybrid")
            payload: The JSON payload to send
        
        Returns:
            requests.Response object
        
        Raises:
            ValueError: If DEVREV_API_KEY environment variable is not set
        """
        api_key = os.environ.get("DEVREV_API_KEY")
        if not api_key:
            raise ValueError("DEVREV_API_KEY environment variable is not set")
    
        headers = {
            "Authorization": f"{api_key}",
            "Content-Type": "application/json",
        }
        
        return requests.post(
            f"https://api.devrev.ai/{endpoint}",
            headers=headers,
            json=payload
        ) 
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. 'List all parts' implies a read operation, but the description doesn't mention pagination behavior (though the schema has a cursor parameter), rate limits, authentication requirements, or what happens when no parts exist. It doesn't describe the return format or any side effects. For a tool with 12 parameters and no annotation coverage, this is insufficient.

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 extremely concise at just 6 words. It's front-loaded with the core purpose and wastes no words. Every element ('List', 'all parts', '(enhancements)', 'in DevRev') contributes to understanding, making it efficiently structured despite its brevity.

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 complex tool with 12 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'parts' are in the DevRev context, how filtering works, what the response looks like, or any behavioral constraints. The agent would struggle to use this tool effectively without significant trial-and-error or external knowledge.

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 67%, so the schema documents most parameters well. The description adds no parameter information beyond what's in the schema - it doesn't explain what 'parts' or 'enhancements' mean in context, nor does it clarify the relationship between parameters. The baseline is 3 since the schema does substantial documentation work, but the description doesn't compensate for the 33% coverage gap or add meaningful context.

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

Purpose3/5

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

The description 'List all parts (enhancements) in DevRev' clearly states the verb ('List') and resource ('parts'), but it's vague about scope and differentiation. It doesn't specify whether this lists ALL parts unconditionally or just those matching filter criteria, and doesn't distinguish it from sibling tools like 'get_part' (singular) or 'search' (which might handle parts). The parenthetical '(enhancements)' adds some context but doesn't fully clarify.

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. There's no mention of when to choose 'list_parts' over 'search' (which appears in sibling tools) or 'get_part' (singular). It doesn't indicate whether this is for browsing all parts versus filtered queries, nor does it mention any prerequisites or constraints for usage.

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/devrev/mcp-server'

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