hero_osis: MCP tools have data format issues (contact_set, contacts_list) #41

Closed
opened 2026-03-18 20:12:03 +00:00 by mik-tf · 1 comment
Owner

Issues

1. contact_set rejects JSON objects

The MCP tool schema declares data as type: "object", but the backend errors with:

Redis operation error: Missing required parameter: obj (OTOML string)

The backend expects an OTOML-serialized string, not a JSON object. Either:

  • The MCP handler should serialize the JSON object to OTOML before passing to the backend, OR
  • The backend should accept JSON objects directly

2. contacts_list returns empty string instead of empty array

When no contacts exist, the tool returns "" (empty string) instead of [] or {"contacts": []}. This makes it hard for AI agents to distinguish "no contacts" from an error.

Verified on

herodev.gent04.grid.tf — tested via direct curl to hero_osis_ui.sock MCP endpoint.

Impact

AI assistants (hero_shrimp) cannot create or manage contacts via MCP because the data format is incompatible.

## Issues ### 1. `contact_set` rejects JSON objects The MCP tool schema declares `data` as `type: "object"`, but the backend errors with: ``` Redis operation error: Missing required parameter: obj (OTOML string) ``` The backend expects an OTOML-serialized string, not a JSON object. Either: - The MCP handler should serialize the JSON object to OTOML before passing to the backend, OR - The backend should accept JSON objects directly ### 2. `contacts_list` returns empty string instead of empty array When no contacts exist, the tool returns `""` (empty string) instead of `[]` or `{"contacts": []}`. This makes it hard for AI agents to distinguish "no contacts" from an error. ## Verified on herodev.gent04.grid.tf — tested via direct curl to `hero_osis_ui.sock` MCP endpoint. ## Impact AI assistants (hero_shrimp) cannot create or manage contacts via MCP because the data format is incompatible.
Author
Owner

Fixed and verified on herodev

Root cause: MCP dispatch in hero_osis_ui/routes.rs had 3 problems:

  1. Wrong method names — used 2-part identity.list which hit wrong domain (business.contact instead of identity.contact)
  2. Wrong data format — sent raw JSON objects instead of OTOML strings (O: prefix + TOML key-value pairs)
  3. Wrong response format — returned raw newline-joined SIDs instead of JSON arrays for list operations

Fix: Updated dispatch_tool() to use 3-part method names (identity.contact.set), convert JSON→OTOML via json_to_otoml_string(), and format list responses as JSON arrays via parse_sid_list().

Verification on herodev:

  • contacts_list[] (was "")
  • contact_set with {"name":"testcontact","public_key":"ed25519:test123"} → returns SID "0002" (was OTOML error)
  • contacts_list after set → ["0002"]
  • contact_get → returns full contact OTOML data

Commit: hero_osis@07cac1a on development

## Fixed and verified on herodev **Root cause**: MCP dispatch in `hero_osis_ui/routes.rs` had 3 problems: 1. Wrong method names — used 2-part `identity.list` which hit wrong domain (`business.contact` instead of `identity.contact`) 2. Wrong data format — sent raw JSON objects instead of OTOML strings (`O:` prefix + TOML key-value pairs) 3. Wrong response format — returned raw newline-joined SIDs instead of JSON arrays for list operations **Fix**: Updated `dispatch_tool()` to use 3-part method names (`identity.contact.set`), convert JSON→OTOML via `json_to_otoml_string()`, and format list responses as JSON arrays via `parse_sid_list()`. **Verification on herodev**: - `contacts_list` → `[]` ✅ (was `""`) - `contact_set` with `{"name":"testcontact","public_key":"ed25519:test123"}` → returns SID `"0002"` ✅ (was OTOML error) - `contacts_list` after set → `["0002"]` ✅ - `contact_get` → returns full contact OTOML data ✅ Commit: hero_osis@07cac1a on `development`
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#41
No description provided.