{
  "openapi": "3.1.1",
  "info": {
    "title": "AI Agent Tool Explorer API",
    "version": "1.0.0",
    "summary": "Index of tools AI agents can call: this site, the MCP Registry or your definitions, by capability.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://aiagenttoolexplorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Index of tools AI agents can call: this site, the MCP Registry or your definitions, by capability.",
        "description": "A searchable index of tools an AI agent can call: this platform's own tools (with API, definition and MCP names), servers in the official MCP Registry, or tool definitions you paste (MCP tools/list, OpenAI function tools, Anthropic tools). Every entry gets inferred capability tags (read, write, delete, execute, network, files, payments, messaging, secrets), a risk level, a parameter summary and a machine-readable JSON-schema definition.\n\nMethodology:\n- Platform tools come from this site's live registry (id, name, tagline, keywords); each links to its definition (GET /api/v1/tools/{id}: input + output JSON Schema), its calculate endpoint and its MCP tool name.\n- MCP Registry: GET https://registry.modelcontextprotocol.io/v0/servers?search=… (official, self-published metadata) with links to the server's latest version record, repository and remote endpoints.\n- Pasted definitions are normalised from MCP (inputSchema), OpenAI (function.parameters) and Anthropic (input_schema) shapes into the MCP tools/list shape.\n- Capabilities and risk use the same rules as the MCP Server Explorer: write/delete/execute from the tool name, network/files/payments/messaging/secrets from name + description. They are inferences, not guarantees.\n- Search scores each query word against name (weight 3), keywords (2) and description (1); prefixes count 60 %.",
        "tags": [
          "ai-infra"
        ],
        "x-mcp-tool": "ai_agent_tool_explorer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAgentToolExplorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Pasted OpenAI + Anthropic tool definitions (offline)",
                  "value": {
                    "mode": "paste",
                    "toolsJson": "[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get the current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\",\"description\":\"City name, e.g. Berlin\"},\"unit\":{\"type\":\"string\",\"enum\":[\"c\",\"f\"]}},\"required\":[\"city\"],\"additionalProperties\":false}}},{\"type\":\"function\",\"function\":{\"name\":\"send_email\",\"description\":\"Send an email to a recipient.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"to\":{\"type\":\"string\"},\"subject\":{\"type\":\"string\"},\"body\":{\"type\":\"string\"}},\"required\":[\"to\",\"subject\",\"body\"]}}},{\"name\":\"delete_file\",\"description\":\"Delete a file from the workspace by path.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\",\"description\":\"Workspace-relative path\"}},\"required\":[\"path\"]}}]"
                  }
                },
                "example2": {
                  "summary": "Search this site's tools only (offline)",
                  "value": {
                    "mode": "search",
                    "query": "mcp server",
                    "includeRegistry": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentToolExplorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AiAgentToolExplorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "title": "What do you want to explore?",
            "type": "string",
            "enum": [
              "search",
              "paste"
            ],
            "default": "search"
          },
          "query": {
            "title": "Search",
            "description": "Matches names, descriptions and keywords. In paste mode it filters the pasted tools.",
            "type": "string",
            "maxLength": 200
          },
          "includeRegistry": {
            "title": "Also search the official MCP Registry",
            "type": "boolean",
            "default": true
          },
          "toolsJson": {
            "title": "Tool definitions JSON",
            "description": "MCP tools/list result, OpenAI \"tools\" array, Anthropic \"tools\" array, or one definition.",
            "type": "string",
            "maxLength": 1000000
          },
          "maxResults": {
            "title": "Maximum results",
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 25
          }
        },
        "required": []
      },
      "AiAgentToolExplorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "mode",
              "query",
              "counts",
              "results"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "search",
                  "paste"
                ]
              },
              "query": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "counts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "platform",
                  "registry",
                  "pasted",
                  "shown"
                ],
                "properties": {
                  "platform": {
                    "type": "integer"
                  },
                  "registry": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "pasted": {
                    "type": "integer"
                  },
                  "shown": {
                    "type": "integer"
                  }
                }
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "source",
                    "id",
                    "name",
                    "description",
                    "capabilities",
                    "risk",
                    "score",
                    "parameters",
                    "issues",
                    "links",
                    "definition"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "enum": [
                        "platform",
                        "mcp-registry",
                        "pasted"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "capabilities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "risk": {
                      "type": "string",
                      "enum": [
                        "high",
                        "medium",
                        "low"
                      ]
                    },
                    "score": {
                      "type": "number"
                    },
                    "parameters": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "name",
                          "type",
                          "required",
                          "description"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "rel",
                          "href"
                        ],
                        "properties": {
                          "rel": {
                            "type": "string"
                          },
                          "href": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "definition": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Machine-readable definition (JSON) in MCP tools/list shape, clipped to 4000 characters."
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}