add-note
Store and organize notes on DICOM medical images using the DICOM-MCP server, enabling efficient management of image-related annotations.
Instructions
Add a new note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| name | Yes |
Implementation Reference
- src/dicom_mcp/server.py:236-255 (handler)The execution logic for the 'add-note' tool within the handle_call_tool function. It validates arguments, stores the note in the global 'notes' dictionary, notifies clients of resource changes, and returns a confirmation message.# Handle the original add-note tool if name == "add-note": note_name = arguments.get("name") content = arguments.get("content") if not note_name or not content: raise ValueError("Missing name or content") # Update server state notes[note_name] = content # Notify clients that resources have changed await server.request_context.session.send_resource_list_changed() return [ types.TextContent( type="text", text=f"Added note '{note_name}' with content: {content}", ) ]
- src/dicom_mcp/server.py:157-164 (schema)Input JSON schema for the 'add-note' tool defining required 'name' and 'content' as strings.inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], },
- src/dicom_mcp/server.py:154-165 (registration)Registration of the 'add-note' tool in the list_tools response, specifying name, description, and schema.types.Tool( name="add-note", description="Add a new note", inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], }, ),
- src/dicom_mcp/server.py:25-25 (helper)Global storage dictionary for notes, directly used by the 'add-note' handler.notes: dict[str, str] = {} # Keep the notes functionality for backward compatibility