Skip to main content
Glama
nickweedon

Skeleton MCP Server

by nickweedon

update_item

Modify existing items in the Skeleton MCP Server by updating names, descriptions, or metadata using item identifiers.

Instructions

Update an existing item.

Args: item_id: The unique identifier of the item to update name: New name (optional) description: New description (optional) metadata: New metadata (optional, replaces existing)

Returns: The updated item data

Raises: ValueError: If the item is not found

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
item_idYes
nameNo
descriptionNo
metadataNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'update_item' tool. It updates an existing item in the mock data store by copying the item, applying optional updates to name, description, and metadata, updating the timestamp, and returning the updated item.
    async def update_item(
        item_id: str,
        name: str | None = None,
        description: str | None = None,
        metadata: dict[str, str] | None = None,
    ) -> dict[str, Any]:
        """
        Update an existing item.
    
        Args:
            item_id: The unique identifier of the item to update
            name: New name (optional)
            description: New description (optional)
            metadata: New metadata (optional, replaces existing)
    
        Returns:
            The updated item data
    
        Raises:
            ValueError: If the item is not found
        """
        # In a real implementation:
        # client = get_client()
        # return client.put(f"items/{item_id}", data={"name": name, "description": description, "metadata": metadata})
    
        if item_id not in MOCK_ITEMS:
            raise ValueError(f"Item not found: {item_id}")
    
        from datetime import datetime, timezone
    
        item = MOCK_ITEMS[item_id].copy()
    
        if name is not None:
            item["name"] = name
        if description is not None:
            item["description"] = description
        if metadata is not None:
            item["metadata"] = metadata
    
        item["updated_at"] = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
    
        MOCK_ITEMS[item_id] = item
        return item
  • Registers the update_item handler as an MCP tool using the mcp.tool() decorator.
    mcp.tool()(example.update_item)
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. It states the tool updates an item and raises an error if not found, but lacks details on permissions, side effects (e.g., whether metadata replacement is destructive), rate limits, or response format. The mention of 'replaces existing' for metadata is a minor behavioral hint, but overall disclosure is insufficient for a mutation tool.

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 sections (Args, Returns, Raises) and front-loaded purpose. Every sentence adds value: the first states the action, and subsequent lines explain parameters, output, and errors without redundancy. 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, 0% schema coverage, and an output schema present (so return values are covered), the description is moderately complete. It covers basic purpose and parameters but lacks behavioral details like auth needs or mutation impacts. For a 4-param update tool, it should include more context on usage and effects to be fully adequate.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context: 'item_id' is the unique identifier, 'name' and 'description' are optional new values, and 'metadata' optionally replaces existing metadata. This clarifies beyond the schema's types and nullability, though it doesn't detail format constraints (e.g., string length).

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 'update' and resource 'existing item', making the purpose unambiguous. It distinguishes from siblings like 'create_item' (new item) and 'delete_item' (remove item), though it doesn't explicitly contrast with 'get_item' or 'list_items' beyond the update action.

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 guidance is provided on when to use this tool versus alternatives like 'create_item' for new items or 'get_item' for retrieval. The description mentions a 'ValueError' for missing items, but this is an error case rather than usage advice. It lacks context about prerequisites or typical scenarios.

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/nickweedon/mcp_server_template'

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