Skip to main content

get_command

Function get_command 

Source
pub async fn get_command(
    app_state: Data<AppState>,
    path: Path<(String, String)>,
) -> Result<HttpResponse, AppError>
Expand description

Retrieves a specific command by type and ID

§HTTP Route

GET /commands/{command_type}/{id}

§Path Parameters

  • command_type: Type of command (“workflow”, “skill”, or “mcp”)
  • id: Unique identifier of the command

§Response Format

Returns command details including content (for workflows and skills):

{
  "id": "workflow-myworkflow",
  "name": "myworkflow",
  "content": "# My Workflow\n...",
  "type": "workflow"
}

§Response Status

  • 200 OK: Command found and returned
  • 404 Not Found: Command not found or MCP tool (which doesn’t support content retrieval)

§Example

curl http://localhost:3000/commands/workflow/myworkflow
curl http://localhost:3000/commands/skill/myskill