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

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)

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