Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/sys/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (s *SysServer) HandleRequest(method string, params json.RawMessage) (interf
log.Printf("Failed to unmarshal tool call params: %v", err)
return nil, fmt.Errorf("invalid params: %w", err)
}
if callParams.Name == "" {
log.Printf("Tool call missing name field")
return nil, fmt.Errorf("invalid params: missing tool name")
}
log.Printf("Calling tool: name=%s", callParams.Name)
return s.callTool(callParams.Name, callParams.Arguments)
default:
Expand Down
4 changes: 0 additions & 4 deletions internal/sys/sys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@ func TestHandleRequest_ToolsCall_UnknownTool(t *testing.T) {
name: "unknown tool",
toolName: "unknown_tool",
},
{
name: "empty tool name",
toolName: "",
},
{
name: "misspelled tool",
toolName: "sys_initialize",
Expand Down
Loading