update_protocol_description
Modify the description of an existing scientific protocol on protocols.io using its unique identifier to maintain accurate documentation.
Instructions
Update the description of an existing protocol by its protocol ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protocol_id | Yes | Unique identifier for the protocol | |
| description | Yes | New description for the protocol (plain text only) |
Implementation Reference
- The handler function decorated with @mcp.tool(), implementing the logic to update a protocol's description by making PUT and GET requests to the protocols.io API, returning the updated protocol or an error.@mcp.tool() async def update_protocol_description( protocol_id: Annotated[int, Field(description="Unique identifier for the protocol")], description: Annotated[str, Field(description="New description for the protocol (plain text only)")] ) -> Protocol | ErrorMessage: """ Update the description of an existing protocol by its protocol ID. """ data = {"description": description} response_update_protocol = await helpers.access_protocols_io_resource("PUT", f"/v4/protocols/{protocol_id}", data) if response_update_protocol["status_code"] != 0: return ErrorMessage.from_string(response_update_protocol["status_text"]) response_get_protocol = await helpers.access_protocols_io_resource("GET", f"/v4/protocols/{protocol_id}") if response_get_protocol["status_code"] != 0: return ErrorMessage.from_string(response_get_protocol["status_text"]) protocol = await Protocol.from_protocol_id(response_get_protocol["payload"]["id"]) return protocol
- Input schema defined via Annotated types for protocol_id (int) and description (str), with output union of Protocol or ErrorMessage models.protocol_id: Annotated[int, Field(description="Unique identifier for the protocol")], description: Annotated[str, Field(description="New description for the protocol (plain text only)")] ) -> Protocol | ErrorMessage:
- src/protocols_io_mcp/tools/protocol.py:258-258 (registration)The @mcp.tool() decorator registers this function as an MCP tool named 'update_protocol_description'.@mcp.tool()