Skip to main content
Glama
by bossjones

add-note

Create and store a new note with a name and content using the Datetime MCP Server, enabling organized management and summary generation for stored notes.

Instructions

Add a new note

Input Schema

NameRequiredDescriptionDefault
contentYes
nameYes

Input Schema (JSON Schema)

{ "properties": { "content": { "type": "string" }, "name": { "type": "string" } }, "required": [ "name", "content" ], "type": "object" }

Implementation Reference

  • The handler for the 'add-note' tool within the handle_call_tool function. It validates the required 'name' and 'content' arguments, stores the note in the global 'notes' dictionary, notifies connected sessions of resource changes if possible, and returns a confirmation message.
    if name == "add-note": 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 - only if in a request context try: await server.request_context.session.send_resource_list_changed() except LookupError: # Running outside of a request context (e.g., in tests) pass return [ types.TextContent( type="text", text=f"Added note '{note_name}' with content: {content}", ) ]
  • JSON Schema defining the input for the 'add-note' tool, requiring 'name' and 'content' as strings.
    inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], },
  • Registration of the 'add-note' tool in the handle_list_tools function, including name, description, and input schema.
    types.Tool( name="add-note", description="Add a new note", inputSchema={ "type": "object", "properties": { "name": {"type": "string"}, "content": {"type": "string"}, }, "required": ["name", "content"], }, ),
  • Global dictionary 'notes' that persists the state of added notes, used by the 'add-note' tool handler and resource listing/reading functions.
    # Store notes as a simple key-value dict to demonstrate state management notes: dict[str, str] = {}

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bossjones/datetime-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server