@monitoro/herd
Version:
Automate your browser, build AI web tools and MCP servers with Monitoro Herd
139 lines (138 loc) • 5.66 kB
JavaScript
export const swaggerDocument = {
openapi: "3.0.0",
info: {
title: "Herd Trail Server API",
version: "1.0.0",
description: "API for dynamically loading and running Herd Trails."
},
servers: [
{
url: "/api",
description: "Trail Server API"
}
],
paths: {
"/run/{trailIdentifier}/{actionName}": {
post: {
summary: "Run a specific action from a dynamically loaded trail.",
description: "This endpoint allows you to execute an action from a Herd Trail. If the trail is not already loaded, it will be dynamically downloaded and registered from the Herd registry. The trailIdentifier should include the organization prefix (e.g., @org/trail-name).",
parameters: [
{
in: "path",
name: "trailIdentifier",
required: true,
schema: {
type: "string",
pattern: "^@[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$"
},
description: "The identifier of the trail (e.g., @omneity/serp)."
},
{
in: "path",
name: "actionName",
required: true,
schema: {
type: "string"
},
description: "The name of the action to run within the trail."
}
],
requestBody: {
description: "Parameters to pass to the action, as a JSON object.",
required: false,
content: {
"application/json": {
schema: {
type: "object",
additionalProperties: true,
example: {
query: "latest news",
count: 5
}
}
}
}
},
responses: {
"200": {
description: "Action executed successfully.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
result: {
type: "object",
description: "The result of the action execution.",
additionalProperties: true
}
}
}
}
}
},
"400": {
description: "Invalid request.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
error: {
type: "string"
}
}
}
}
}
},
"404": {
description: "Trail or action not found.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
error: {
type: "string"
}
}
}
}
}
},
"500": {
description: "Internal server error.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
error: {
type: "string"
}
}
}
}
}
},
"503": {
description: "Service unavailable (e.g., no devices).",
content: {
"application/json": {
schema: {
type: "object",
properties: {
error: {
type: "string"
}
}
}
}
}
}
}
}
}
}
};