{
  "info": {
    "description": "AEO + Agent-API layer for Next.js App Router. Make your site readable by AI and callable by agents.",
    "title": "next-ai-ready — AI Actions",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/actions/get_page_content": {
      "post": {
        "description": "When you know which page the user needs and want to read its full content.",
        "operationId": "get_page_content",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "route": {
                    "description": "Page route, e.g. '/en/docs/introduction' or '/zh/docs/guides/quickstart'",
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "route"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "content": {
                      "type": "string"
                    },
                    "found": {
                      "type": "boolean"
                    },
                    "route": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "route",
                    "title",
                    "summary",
                    "content",
                    "found"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Handler error"
          }
        },
        "summary": "Get the markdown content of a documentation page by its route.",
        "tags": [
          "docs",
          "content"
        ],
        "x-ai-when-not-to-use": "When you need to search for pages first (use search_docs instead).",
        "x-ai-when-to-use": "When you know which page the user needs and want to read its full content."
      }
    },
    "/api/actions/list_api_methods": {
      "post": {
        "description": "When you need to discover what tools are available before calling them.",
        "operationId": "list_api_methods",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "methods": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tags": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          }
                        },
                        "required": [
                          "name",
                          "description",
                          "tags"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "methods"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Handler error"
          }
        },
        "summary": "List all available API methods (actions) with their names and descriptions.",
        "tags": [
          "api",
          "discovery"
        ],
        "x-ai-when-not-to-use": "When you already know which action to call.",
        "x-ai-when-to-use": "When you need to discover what tools are available before calling them."
      }
    },
    "/api/actions/search_docs": {
      "post": {
        "description": "When the user asks about a topic and you need to find relevant documentation pages.",
        "operationId": "search_docs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "limit": {
                    "description": "Max results to return (default 5)",
                    "maximum": 20,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "query": {
                    "description": "Search keyword or phrase",
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "results": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "route": {
                            "type": "string"
                          },
                          "section": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "route",
                          "title",
                          "summary",
                          "section"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "total": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "results",
                    "total"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "details": {},
                    "message": {
                      "type": "string"
                    },
                    "ok": {
                      "const": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok",
                    "code",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Handler error"
          }
        },
        "summary": "Search documentation pages by keyword. Returns matching pages with title, summary, and route.",
        "tags": [
          "docs",
          "search"
        ],
        "x-ai-when-not-to-use": "When the user asks for the full content of a specific page (use get_page_content instead).",
        "x-ai-when-to-use": "When the user asks about a topic and you need to find relevant documentation pages."
      }
    }
  },
  "servers": [
    {
      "description": "next-ai-ready",
      "url": "https://next-ai-ready.vercel.app"
    }
  ]
}
