register_slash_command
Register a workspace slash command to run an HTTP handler or MCP tool when users post /name text, returning the command and signing secret for webhook verification.
Instructions
Register a workspace slash command: a message posted as /name text then runs the handler. With handler_kind http, Maidan POSTs a JSON payload (command, name, text, workspace_id, channel_id, thread_id, author_id, message_id) signed in the X-Maidan-Signature header to handler_target, and this call returns {command, secret} with the signing secret. With mcp_tool it runs the named MCP tool and returns the command. The name must not be in use by an active command; list them with list_slash_commands and free a name with revoke_slash_command. Requires workspace:write; mcp_tool also needs the capability the target tool requires, plus channel:admin when that tool is not read-only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace_id": "<workspace_id>",
"name": "<name>",
"handler_kind": "<handler_kind>",
"handler_target": "<handler_target>"
},
"name": "register_slash_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Command name. A leading slash is stripped and the name is lowercased; 1 to 32 characters from a-z, 0-9, underscore and hyphen. | |
| description | No | Optional text describing what the command does, stored with the command and returned by list_slash_commands. | |
| handler_kind | Yes | http to deliver the command to a URL, or mcp_tool to run an MCP tool by name. | |
| workspace_id | Yes | UUID of your own workspace (whoami returns it). A different workspace is refused. | |
| handler_target | Yes | For http, the URL that receives the POST; it must pass the server's outbound-request check. For mcp_tool, the exact name of an MCP tool, for example whoami; an unknown name is refused. |