Action fails when using params

I am building a custom GPT and observe the following behaviour: When my action (calling a REST API endpoint) is performed, it will instantly fail if there are params attached to the request.

Examples
(note: the domain is changed for privacy reasons)

This works:

[debug] Calling HTTP endpoint
{
  "domain": "umami.example.com",
  "method": "get",
  "path": "/node/recipe",
  "operation": "JsonapiNodeRecipeGet",
  "operation_hash": "0f132aa91594a6f5be9fff833eeca6c3a90e99cf",
  "is_consequential": false,
  "params": {}
}

[debug] Response received
Talked to umami.example.com

This fails:

[debug] Calling HTTP endpoint
{
  "domain": "umami.example.com",
  "method": "get",
  "path": "/node/recipe",
  "operation": "JsonapiNodeRecipeGet",
  "operation_hash": "0f132aa91594a6f5be9fff833eeca6c3a90e99cf",
  "is_consequential": false,
  "params": {
    "page": {
      "limit": 10
    }
  }
}

[debug] Response received
{}
Error talking to

I asked the GPT builder to output the URL for this request, including the GET params, and it responded with

https://umami.example.com/jsonapi/node/recipe?page[limit]=10

This URL is structured correctly and should definitely work. My server logs do not show any errors (or even access), so I believe ChatGPT does not even send any request.

I deleted my action several times and added it again, but the result is the same.

Has anyone encountered a similar issue?

I would do two things:

  1. Use https://www.postman.com/ (or something similar) to make sure that URL format is correct. I it is not, you will see the exact message being returned by the server.

  2. If at all possible to access, review the umami.example.com server logs for the requests to see what error, if any, is being thrown.

This is how I’ve been able to troubleshoot GPT actions.

Thank you. But no, server logs are completely empty - nothing in the error log, and nothing in the access log. This is why I believe that the requests do not get executed on the OpenAI/ChatGPT side.

The issue still persists.

Well, logically, if you so not see the request in any of your server access logs, then it is more than likely not being sent.

However, if this is the correct url:

Then, this path is incorrect:

Shouldn’t this be the path:

Correct. This looks like another bug in ChatGPT.

In the OpenAPI schema, there is this “server” object:

  "servers": [
    {
      "url": "https://umami.example.com/jsonapi",
      "description": "The current environment"
    }
  ],

Every path in the schema is therefore relative to /jsonapi. So /node/recipe becomes /jsonapi/node/recipe and so on. This, however, works, ChatGPT simply does not include the server url in the debug message and just prints the domain name and the action’s path.

I worked on creating a minimal test case to reproduce the issue:

  1. Go to simplytestme and hit the “Umami Demo” button. This will spin up a temporary Drupal website with the Umami demo content.
  2. On the demo page go to /user/login. The credentials will be admin / admin.
  3. In the admin menu, go to “Extend” and enable the “JSON:API” module.
  4. Create a custom GPT and add an action with this schema (replace [URL_TO_THE_DEMO_PAGE] with the actual url that was created in step 1:
openapi: 3.0.0
info:
  title: Sample API
  version: 1.0.0
servers:
  - url: https://[URL_TO_THE_DEMO_PAGE]/jsonapi
paths:
  /node/recipe:
    get:
      operationId: JsonapiNodeRecipeGet
      summary: Sample GET request
      description: This is a sample GET request with a single string parameter.
      parameters:
        - name: page
          in: query
          description: A sample string parameter
          required: true
          schema:
            type: object
            properties:
              limit:
                type: integer
                example: 10
      responses:
        "200":
          description: Successful response
          content:
            application/vnd.api+json:
              schema:
                type: object

The action then fails like I described in the initial post.

You can confirm that the request actually works by browsing to https://[URL_TO_THE_DEMO_PAGE]/jsonapi/node/recipe?page[limit]=5

With this, I am out of ideas.

Are you sure what you’re returning is compliant with that spec

Yes, I am! I checked this using CURL.

curl -I “[…]/jsonapi/node/recipe?page[limit]=5”

HTTP/2 200
date: Wed, 20 Mar 2024 13:32:54 GMT
server: Apache/2.4.57 (Debian)
cache-control: must-revalidate, no-cache, private
content-language: en
content-length: 48967
content-type: application/vnd.api+json
expires: Sun, 19 Nov 1978 05:00:00 GMT
x-content-type-options: nosniff
x-drupal-cache: HIT
x-drupal-dynamic-cache: HIT
x-forwarded-host: […]
x-frame-options: SAMEORIGIN
x-generator: Drupal 10
x-powered-by: PHP/8.1.27
x-robots-tag: noindex, nofollow
x-tugboat-protocol: http