Skip to content

Commit 4875b7a

Browse files
dennys246claude
andcommitted
fix(tools): accept param aliases on say, think, speak
LLMs send varying param names for the same concept: - say/speak: accept text, message, or phrase - think: accept thought, text, or prompt This complements the tool alias map (name redirect) with param flexibility so aliased calls like dialogue(text=...) -> say and reflection(prompt=...) -> think succeed end-to-end. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0f74559 commit 4875b7a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/maxim/tools/narrative.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class SayTool(Tool):
3737
}
3838

3939
def execute(self, **kwargs: Any) -> ToolResult:
40-
text = kwargs.get("text", "")
40+
# Accept common LLM param aliases for the text to say
41+
text = kwargs.get("text") or kwargs.get("message") or kwargs.get("phrase") or ""
4142
if not text:
4243
return ToolResult(success=False, error="Nothing to say")
4344
return ToolResult(
@@ -68,7 +69,8 @@ class ThinkTool(Tool):
6869
}
6970

7071
def execute(self, **kwargs: Any) -> ToolResult:
71-
thought = kwargs.get("thought", "")
72+
# Accept common LLM param aliases for the thought content
73+
thought = kwargs.get("thought") or kwargs.get("text") or kwargs.get("prompt") or ""
7274
if not thought:
7375
return ToolResult(success=False, error="Empty thought")
7476
return ToolResult(

src/maxim/tools/response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def execute(
136136
Returns:
137137
ToolResult with success status.
138138
"""
139-
# Accept 'message' as alias for 'text' (LLMs often use 'message')
140-
if not text and kwargs.get("message"):
141-
text = kwargs["message"]
139+
# Accept common LLM param aliases for the text to speak
140+
if not text:
141+
text = kwargs.get("message") or kwargs.get("phrase") or ""
142142
if not text or not text.strip():
143143
return ToolResult(
144144
success=False,

0 commit comments

Comments
 (0)