Add create_note_from_template MCP tool #31
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-mcp!31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "28-add-create-note-from-template-tool"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a
create_note_from_templateMCP tool that wraps the SDK'screate_note_from_template()method, allowing agents to create notes from Jinja2 templates by passing structured data (as a JSON string) instead of raw HTML.Changes
src/pal_e_docs_mcp/tools/notes.py— Addedimport jsonand thecreate_note_from_templatetool function. Follows the same@mcp.tool()/Annotated[..., Field()]/_ok()/_error_response()pattern ascreate_note. Parsesdatafrom JSON string to dict viajson.loads(), validates it is a dict, splits comma-separatedtagsto a list, and forwards all params to the SDK.tests/test_param_alignment.py— AddedTestCreateNoteFromTemplateclass with 10 unit tests covering: valid JSON data, invalid JSON error, non-object JSON error, tags CSV splitting, tags None sends empty list, trailing comma handling, optional metadata forwarding, SDK error handling, empty object data, and scalar JSON error.uv.lock— Lockfile specifier updated to match pyproject.toml's>=0.2.0SDK floor (was stale at>=0.1.0).Test Plan
cd ~/pal-e-docs-mcp && PALDOCS_BASE_URL=https://paldocs.tail5b443a.ts.net .venv/bin/pytest tests/ -vcreate_note_from_templatetoolReview Checklist
tools/notes.py(decorator, Annotated params, try/except)dataparam is JSON string at MCP layer, parsed to dict before SDK callcreate_notebehavior (comma-separated, strip whitespace, filter empty)__init__.pyorserver.pyRelated
plan-2026-03-09-template-renderingCloses #28