get_my_protocols
Retrieve basic information for all protocols belonging to the current user from protocols.io. Use this tool to access protocol overviews before getting detailed steps.
Instructions
Retrieve basic information for all protocols belonging to the current user. To get detailed protocol steps, use get_protocol_steps.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'get_my_protocols' tool. It is decorated with @mcp.tool(), fetches the current user's profile, queries the protocols.io API for the user's protocols, and returns a list of Protocol objects or an ErrorMessage.@mcp.tool() async def get_my_protocols() -> list[Protocol] | ErrorMessage: """ Retrieve basic information for all protocols belonging to the current user. To get detailed protocol steps, use get_protocol_steps. """ response_profile = await helpers.access_protocols_io_resource("GET", f"/v3/session/profile", {}) if response_profile["status_code"] != 0: return ErrorMessage.from_string(response_profile["error_message"]) user = User.from_api_response(response_profile["user"]) response = await helpers.access_protocols_io_resource("GET", f"/v3/researchers/{user.username}/protocols?filter=user_all") if response["status_code"] != 0: return ErrorMessage.from_api_response(response["error_message"]) protocols = [await Protocol.from_protocol_id(protocol["id"]) for protocol in response.get("items")] return protocols
- src/protocols_io_mcp/server.py:10-10 (registration)The registration of tools occurs by importing the tools module in the FastMCP server setup, which loads all @mcp.tool()-decorated functions including get_my_protocols.importlib.import_module('protocols_io_mcp.tools')