Skip to content

Commit 7382aa7

Browse files
claudefrousselet
authored andcommitted
Fix swot_item MCP tool using wrong field names
The swot_item tool had field names that didn't match the SwotItem model: - type → quadrant - title → (removed, doesn't exist on model) - impact → impact_level - priority → (removed, doesn't exist on model) - analysis_id → swot_analysis_id - reference → (removed, SwotItem doesn't inherit BaseModel) This made create/update/list operations non-functional for SWOT items. https://claude.ai/code/session_01Pp4xLFJ2t2zJui42GTUNNL
1 parent ed09e02 commit 7382aa7

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

mcp/tools.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,17 +421,23 @@ def _register_context_tools(server):
421421
filters=["status"],
422422
field_overrides=_HTML_DESC)
423423

424-
swot_item_fields = ["id", "reference", "type", "title", "description", "impact",
425-
"priority", "order", "analysis_id", "created_at"]
426-
swot_item_writable = ["type", "title", "description", "impact", "priority", "order", "analysis_id"]
424+
swot_item_fields = ["id", "quadrant", "description", "impact_level",
425+
"order", "swot_analysis_id", "created_at"]
426+
swot_item_writable = ["quadrant", "description", "impact_level", "order",
427+
"swot_analysis_id"]
427428

428429
_register_crud(server, "swot_item", SwotItem, "context.swot",
429430
list_fields=swot_item_fields,
430431
writable_fields=swot_item_writable,
431-
search_fields=["title", "description"],
432-
filters=["analysis_id", "type"],
432+
search_fields=["description"],
433+
filters=["swot_analysis_id", "quadrant"],
433434
scope_filtered=False,
434-
field_overrides=_HTML_DESC)
435+
field_overrides={
436+
"description": _html_field("Description"),
437+
"quadrant": {"type": "string", "description": "SWOT quadrant (strength, weakness, opportunity, threat)"},
438+
"impact_level": {"type": "string", "description": "Impact level (low, medium, high)"},
439+
"swot_analysis_id": {"type": "string", "description": "UUID of the parent SWOT analysis"},
440+
})
435441

436442
role_fields = ["id", "reference", "name", "description", "type", "status",
437443
"is_approved", "created_at"]

0 commit comments

Comments
 (0)