{
  "openapi": "3.0.3",
  "info": {
    "title": "Pullnote MCP API",
    "version": "1.0.0",
    "description": "API for creating and retrieving headless CMS content via MCP protocol."
  },
  "servers": [
    {
      "url": "https://api.pullnote.com"
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "summary": "Perform content actions (create, retrieve, update, delete, list)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tool": {
                    "type": "string",
                    "enum": ["note"],
                    "description": "The tool to use (only 'note' supported)"
                  },
                  "action": {
                    "type": "string",
                    "enum": ["create", "retrieve", "update", "delete", "list"],
                    "description": "The action to perform"
                  },
                  "params": {
                    "type": "object",
                    "description": "Parameters for the action"
                  },
                  "pullnote_key": {
                    "type": "string",
                    "description": "API key for authentication"
                  }
                },
                "required": ["tool", "action", "params", "pullnote_key"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "result": { "type": "object" }
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Note": {
        "type": "object",
        "properties": {
          "_id": { "type": "string" },
          "path": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "content": { "type": "string" },
          "created": { "type": "string", "format": "date-time" },
          "modified": { "type": "string", "format": "date-time" },
          "author": { "type": "string" },
          "project_id": { "type": "string" },
          "imgUrl": { "type": "string" },
          "prompt": { "type": "string" },
          "imgPrompt": { "type": "string" },
          "data": { "type": "object" }
        }
      }
    }
  }
} 