add-note
Create and store notes for DICOM medical images to document observations, findings, or annotations directly within the imaging workflow.
Instructions
Add a new note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| content | Yes |
Implementation Reference
- src/dicom_mcp/server.py:237-255 (handler)The handler function for the 'add-note' tool within the @server.call_tool() method. It extracts 'name' and 'content' from arguments, validates them, stores the note in the global 'notes' dict, notifies clients of resource list changes, and returns a TextContent confirmation.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:154-165 (registration)Registration of the 'add-note' tool in the @server.list_tools() handler, including name, description, and input schema definition.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:157-164 (schema)JSON schema for 'add-note' tool inputs, requiring 'name' and 'content' as strings.inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], },
- src/dicom_mcp/server.py:25-25 (helper)Global dictionary used to store notes by name, serving as the persistent storage for the 'add-note' tool.notes: dict[str, str] = {} # Keep the notes functionality for backward compatibility