{
  "service": "turbot_pipes",
  "displayName": "Turbot Pipes",
  "categories": [
    "Data",
    "Developer Tools"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Token",
      "placeholder": "TURBOT_PIPES_TOKEN",
      "description": "Turbot Pipes API token sent as a Bearer token. Create or manage tokens from your Turbot Pipes profile: https://turbot.com/pipes/docs/profile#tokens.",
      "extraFields": [
        {
          "key": "userHandle",
          "label": "User Handle",
          "inputType": "text",
          "required": true,
          "secret": false,
          "placeholder": "your-user-handle",
          "description": "Turbot Pipes user handle that owns the workspace used for Query API requests."
        },
        {
          "key": "workspaceHandle",
          "label": "Workspace Handle",
          "inputType": "text",
          "required": true,
          "secret": false,
          "placeholder": "your-workspace-handle",
          "description": "Turbot Pipes workspace handle where SQL queries should run."
        }
      ]
    }
  ],
  "homepageUrl": "https://turbot.com/pipes",
  "actions": [
    {
      "id": "turbot_pipes.execute_query",
      "service": "turbot_pipes",
      "name": "execute_query",
      "description": "Execute a SQL query with the Turbot Pipes Query API and return rows plus query metadata.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "sql": {
            "type": "string",
            "minLength": 1,
            "description": "The SQL statement to execute in Turbot Pipes."
          }
        },
        "additionalProperties": false,
        "required": [
          "sql"
        ],
        "description": "Input for executing a Turbot Pipes SQL query."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One Turbot Pipes SQL query result row."
            },
            "description": "Rows returned by the query."
          },
          "rowCount": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of rows returned by the query."
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The column name returned by Turbot Pipes."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The Turbot Pipes column type when returned."
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": true,
              "description": "A Turbot Pipes SQL query result column."
            },
            "description": "Columns inferred from the query response."
          },
          "meta": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Turbot Pipes query metadata returned by the Query API."
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {
            "description": "The raw Turbot Pipes Query API response."
          }
        },
        "additionalProperties": false,
        "required": [
          "rows",
          "rowCount",
          "columns",
          "meta",
          "raw"
        ],
        "description": "A normalized Turbot Pipes SQL query result."
      }
    }
  ]
}
