openapi: 3.1.0 info: title: Agent description: Agent registry service version: 0.1.0 servers: - url: http://localhost:8003 description: Local agent service paths: /probe: get: operationId: probe summary: Check service and database health responses: "200": description: Service and database are reachable content: application/json: schema: $ref: "#/components/schemas/ProbeOk" example: service: ok database: ok "503": description: Database is unreachable content: application/json: schema: $ref: "#/components/schemas/ProbeError" example: error: connection refused /api/v1/agents: get: operationId: listAgents summary: List all agents responses: "200": description: Agents ordered by name content: application/json: schema: $ref: "#/components/schemas/AgentListResponse" /api/v1/agents/usage/mcp/{mcp_name}: get: operationId: listMcpUsage summary: List agents that reference an MCP server parameters: - $ref: "#/components/parameters/McpName" responses: "200": description: Agent names that include the MCP server content: application/json: schema: $ref: "#/components/schemas/ReferenceListResponse" /api/v1/agents/usage/skill/{skill_name}: get: operationId: listSkillUsage summary: List agents that reference a skill parameters: - $ref: "#/components/parameters/SkillName" responses: "200": description: Agent names that include the skill content: application/json: schema: $ref: "#/components/schemas/ReferenceListResponse" /api/v1/agents/usage/knowledge/{knowledge_name}: get: operationId: listKnowledgeUsage summary: List agents that reference a knowledge source parameters: - $ref: "#/components/parameters/KnowledgeName" responses: "200": description: Agent names that include the knowledge source content: application/json: schema: $ref: "#/components/schemas/ReferenceListResponse" /api/v1/agents/{name}: parameters: - $ref: "#/components/parameters/AgentName" get: operationId: getAgent summary: Get an agent by name responses: "200": description: Agent found content: application/json: schema: $ref: "#/components/schemas/AgentResponse" "404": $ref: "#/components/responses/NotFound" "422": $ref: "#/components/responses/ValidationError" post: operationId: createAgent summary: Create an agent requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AgentInput" responses: "201": description: Agent created content: application/json: schema: $ref: "#/components/schemas/AgentNameResponse" "409": description: Agent already exists content: application/json: schema: $ref: "#/components/schemas/ErrorDetail" example: detail: Agent already exists "422": $ref: "#/components/responses/ValidationError" put: operationId: updateAgent summary: Replace an agent requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AgentInput" responses: "200": description: Agent updated content: application/json: schema: $ref: "#/components/schemas/AgentNameResponse" "404": $ref: "#/components/responses/NotFound" "422": $ref: "#/components/responses/ValidationError" delete: operationId: deleteAgent summary: Delete an agent responses: "204": description: Agent deleted "404": $ref: "#/components/responses/NotFound" "422": $ref: "#/components/responses/ValidationError" "409": description: Agent is still referenced by crews content: application/json: schema: $ref: "#/components/schemas/ErrorDetail" example: detail: "Cannot delete agent in use by crews: travel-assistant" "502": $ref: "#/components/responses/RegistryUnavailable" /api/v1/agents/{name}/usage: get: operationId: getAgentUsage summary: List crews that use an agent parameters: - $ref: "#/components/parameters/AgentName" responses: "200": description: Crew names that reference the agent content: application/json: schema: $ref: "#/components/schemas/AgentUsageResponse" "404": $ref: "#/components/responses/NotFound" "422": $ref: "#/components/responses/ValidationError" "502": $ref: "#/components/responses/RegistryUnavailable" components: parameters: AgentName: name: name in: path required: true description: 2–50 letters, numbers, underscores, or hyphens schema: $ref: "#/components/schemas/AgentName" McpName: name: mcp_name in: path required: true schema: type: string minLength: 1 SkillName: name: skill_name in: path required: true schema: type: string minLength: 1 KnowledgeName: name: knowledge_name in: path required: true schema: type: string minLength: 1 responses: NotFound: description: Agent not found content: application/json: schema: $ref: "#/components/schemas/ErrorDetail" example: detail: Agent not found ValidationError: description: Path or request body failed schema validation content: application/json: schema: $ref: "#/components/schemas/HTTPValidationError" RegistryUnavailable: description: Crew registry request failed content: application/json: schema: $ref: "#/components/schemas/ErrorDetail" examples: unavailable: value: detail: "Registry unavailable: http://localhost:8006/api/v1/crews/usage/agent/weather-lookup" failed: value: detail: "Registry request failed: http://localhost:8006/api/v1/crews/usage/agent/weather-lookup (500)" schemas: AgentName: type: string minLength: 2 maxLength: 50 pattern: "^[a-zA-Z0-9_-]{2,50}$" example: weather-lookup AgentInput: type: object additionalProperties: false required: - model - role - goal - backstory properties: model: type: string minLength: 1 role: type: string minLength: 1 goal: type: string minLength: 1 backstory: type: string minLength: 1 tools: type: array items: type: string default: [] mcps: type: array items: type: string default: [] skills: type: array items: type: string default: [] knowledge: type: array items: type: string default: [] example: model: ollama/qwen3:8b role: Travel Weather Specialist goal: Provide weather information for travel destinations. backstory: Extract city name from user information. Provide clear weather summaries. tools: [] mcps: [] skills: - weather-lookup knowledge: [] AgentResponse: type: object required: - name - model - role - goal - backstory - tools - mcps - skills - knowledge - updated_at properties: name: $ref: "#/components/schemas/AgentName" model: type: string role: type: string goal: type: string backstory: type: string tools: type: array items: type: string mcps: type: array items: type: string skills: type: array items: type: string knowledge: type: array items: type: string updated_at: type: string format: date-time AgentListResponse: type: object required: - agents properties: agents: type: array items: $ref: "#/components/schemas/AgentResponse" AgentNameResponse: type: object required: - name properties: name: $ref: "#/components/schemas/AgentName" ReferenceListResponse: type: object required: - references properties: references: type: array items: $ref: "#/components/schemas/AgentName" example: - weather-lookup AgentUsageResponse: type: object required: - crews properties: crews: type: array items: type: string example: - travel-assistant ProbeOk: type: object required: - service - database properties: service: type: string const: ok database: type: string const: ok ProbeError: type: object required: - error properties: error: type: string ErrorDetail: type: object required: - detail properties: detail: type: string ValidationError: type: object properties: loc: type: array items: anyOf: - type: string - type: integer msg: type: string type: type: string HTTPValidationError: type: object properties: detail: type: array items: $ref: "#/components/schemas/ValidationError"