note_add
Add notes or comments to tickets, tasks, projects, or organizations to document context, decisions, and progress updates in project management workflows.
Instructions
PROJECT MANAGEMENT (TPM): Add a note/comment to a ticket or task for context or decisions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_type | Yes | Type of entity | |
| entity_id | Yes | ID of the entity | |
| content | Yes | Note content |
Implementation Reference
- src/tpm_mcp/server.py:382-398 (registration)Registration of the 'note_add' tool within the @server.list_tools() function, defining its name, description, and JSON input schema.Tool( name="note_add", description="PROJECT MANAGEMENT (TPM): Add a note/comment to a ticket or task for context or decisions.", inputSchema={ "type": "object", "properties": { "entity_type": { "type": "string", "enum": ["org", "project", "ticket", "task"], "description": "Type of entity", }, "entity_id": {"type": "string", "description": "ID of the entity"}, "content": {"type": "string", "description": "Note content"}, }, "required": ["entity_type", "entity_id", "content"], }, ),
- src/tpm_mcp/server.py:706-715 (handler)The main handler logic for the 'note_add' tool inside _handle_tool function. It validates input using NoteCreate Pydantic model and delegates persistence to db.add_note, returning a minimal confirmation.if name == "note_add": note = db.add_note( NoteCreate( entity_type=args["entity_type"], entity_id=args["entity_id"], content=args["content"], ) ) # Return minimal confirmation - note content is echoed back by caller anyway return f"Added note {note.id} to {note.entity_type}/{note.entity_id}"
- src/tpm_mcp/models.py:159-162 (schema)Pydantic BaseModel NoteCreate defines the input structure for note_add tool, matching the tool's inputSchema exactly (entity_type, entity_id, content). Used for validation in the handler.class NoteCreate(BaseModel): entity_type: str entity_id: str content: str
- src/tpm_mcp/db.py:758-772 (helper)Core persistence helper method in TrackerDB class that executes the SQL INSERT into the 'notes' table, generates ID and timestamp, commits the transaction, and returns the created Note object.def add_note(self, data: NoteCreate) -> Note: id = self._gen_id() now = self._now() self.conn.execute( "INSERT INTO notes (id, entity_type, entity_id, content, created_at) VALUES (?, ?, ?, ?, ?)", (id, data.entity_type, data.entity_id, data.content, now), ) self.conn.commit() return Note( id=id, entity_type=data.entity_type, entity_id=data.entity_id, content=data.content, created_at=datetime.fromisoformat(now), )