Skip to main content

soma_domain/
actions_help.rs

1use serde_json::{Value, json};
2
3use super::{action_catalog, mcp_only_action_names, rest_action_names};
4
5/// Builds the JSON help payload describing the REST surface and examples.
6pub fn rest_help() -> Value {
7    json!({
8        "actions": rest_action_names(),
9        "mcp_only_actions": mcp_only_action_names(),
10        "catalog": action_catalog(),
11        "preferred_rest_style": "direct_routes",
12        "usage": "Use direct REST routes such as POST /v1/echo or GET /v1/status. MCP keeps a single action-dispatched tool; REST does not expose an action envelope.",
13        "examples": {
14            "greet":  {"method": "POST", "path": "/v1/greet",  "body": {"name": "Alice"}},
15            "echo":   {"method": "POST", "path": "/v1/echo",   "body": {"message": "Hello!"}},
16            "status": {"method": "GET", "path": "/v1/status"},
17        }
18    })
19}