add-note
Create and store notes by specifying a name and content. Integrates with MCPilot, a gateway for the Model Context Protocol, to streamline AI toolchain management.
Instructions
Add a new note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| name | Yes |
Implementation Reference
- src/mcpilot/server.py:125-149 (handler)The specific logic within the call_tool handler that executes the 'add-note' tool: extracts name and content from arguments, stores in global notes dict, sends resource change notification, returns text confirmation.if name != "add-note": raise ValueError(f"Unknown tool: {name}") if not arguments: raise ValueError("Missing arguments") 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/mcpilot/server.py:103-116 (registration)Registration of the 'add-note' tool in the list_tools handler, including 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/mcpilot/server.py:106-113 (schema)Input JSON schema for 'add-note' tool: requires 'name' and 'content' as strings.inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], },
- src/mcpilot/server.py:10-10 (helper)Global dictionary used by 'add-note' to persist note data across calls.notes: dict[str, str] = {}