{
    "openapi": "3.0.3",
    "info": {
        "title": "OpenCart.gr public read API",
        "version": "1.0.35",
        "description": "Read published posts and pages. Anonymous read is allowed. A bearer token with content:read or mcp is accepted and never grants drafts."
    },
    "servers": [
        {
            "url": "https://www.opencart.gr/"
        }
    ],
    "paths": {
        "/wp-json/lateral-agents/v1/content": {
            "get": {
                "operationId": "searchContent",
                "summary": "Search public posts and pages",
                "description": "Returns published posts and pages. An empty search returns the latest public items.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Words to find in public titles and body text.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "Search words."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching public content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "description": "Public posts and pages that matched the query.",
                                    "items": {
                                        "$ref": "#/components/schemas/ContentItem"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The query could not be read.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/lateral-agents/v1/content/{id}": {
            "get": {
                "operationId": "getContent",
                "summary": "Get one public post or page",
                "description": "Returns one published post or page by its WordPress id.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "WordPress post id.",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "description": "Numeric post id."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The public item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentItem"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a public post or page.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/mcp": {
            "post": {
                "operationId": "mcpRpc",
                "summary": "MCP JSON-RPC",
                "description": "Stateless server/discover and tools/list, plus the legacy initialize handshake.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/JsonRpcRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON-RPC result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/JsonRpcResult"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The JSON-RPC body was invalid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/a2a": {
            "post": {
                "operationId": "a2aSend",
                "summary": "A2A message/send",
                "description": "Sends one agent-to-agent message and returns a task.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/JsonRpcRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON-RPC task",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/JsonRpcResult"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The A2A body was invalid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ContentItem": {
                "type": "object",
                "description": "One published post or page an agent can read.",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "WordPress post id."
                    },
                    "type": {
                        "type": "string",
                        "description": "post or page."
                    },
                    "title": {
                        "type": "string",
                        "description": "Public title."
                    },
                    "url": {
                        "type": "string",
                        "description": "Canonical HTML URL."
                    },
                    "markdown_url": {
                        "type": "string",
                        "description": "Markdown URL for the same item."
                    },
                    "excerpt": {
                        "type": "string",
                        "description": "Short plain-text summary."
                    }
                }
            },
            "Error": {
                "type": "object",
                "description": "A failed request. code is stable. message is for the caller.",
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "Stable error code such as not_found."
                    },
                    "message": {
                        "type": "string",
                        "description": "What went wrong."
                    }
                },
                "required": [
                    "code",
                    "message"
                ]
            },
            "JsonRpcRequest": {
                "type": "object",
                "description": "A JSON-RPC 2.0 request.",
                "properties": {
                    "jsonrpc": {
                        "type": "string",
                        "description": "Must be 2.0."
                    },
                    "id": {
                        "description": "Caller id echoed on the result."
                    },
                    "method": {
                        "type": "string",
                        "description": "RPC method name."
                    },
                    "params": {
                        "type": "object",
                        "description": "Method arguments."
                    }
                },
                "required": [
                    "jsonrpc",
                    "method"
                ]
            },
            "JsonRpcResult": {
                "type": "object",
                "description": "A JSON-RPC 2.0 success body.",
                "properties": {
                    "jsonrpc": {
                        "type": "string",
                        "description": "Always 2.0."
                    },
                    "id": {
                        "description": "The id from the request."
                    },
                    "result": {
                        "type": "object",
                        "description": "Method result."
                    }
                },
                "required": [
                    "jsonrpc",
                    "result"
                ]
            }
        }
    }
}
