> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ontime.hosai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect ChatGPT

> Add OnTime as a ChatGPT custom connector, and the search/fetch tool pair it relies on.

ChatGPT connects through the same OAuth facade as Claude — it will not accept a static API key for a remote MCP connector.

## Add the connector

<Steps>
  <Step title="Open connector settings">
    In ChatGPT, add a **custom connector** (available on plans that support MCP connectors).
  </Step>

  <Step title="Enter the MCP URL">
    ```text theme={null}
    https://app.ontime.hosai.app/api/mcp
    ```
  </Step>

  <Step title="Authorize">
    ChatGPT discovers OnTime's authorization server, registers itself, and sends you to sign in. Approve the organization and access level on the consent screen.
  </Step>

  <Step title="Test it">
    > Use OnTime to tell me who I am.

    You should get your name, organization and permissions back.
  </Step>
</Steps>

Discovery, dynamic client registration and PKCE all happen automatically — see [Connect Claude](/ai-mcp/connect/claude) for the sequence, which is identical.

## The search and fetch pair

Alongside the `ontime_*` tools, OnTime exposes two **bare-named** tools:

| Tool     | Does                                                                            |
| -------- | ------------------------------------------------------------------------------- |
| `search` | Searches across the organization and returns matching records with identifiers. |
| `fetch`  | Retrieves one record by the identifier `search` returned.                       |

This pair exists because ChatGPT's deep-research mode expects exactly these two names. It is the generic discovery path: search to find, fetch to read.

<Note>
  **Both are read-only** and gated on `employee:read`. Neither can change anything — writing is always through a specific `ontime_*` tool.
</Note>

<Tip>
  For anything specific, the dedicated tools are better. `ontime_employee_search` returns richer employee results than the generic `search`, and `ontime_leave_get` returns a properly typed leave request rather than a generic record. Use `search`/`fetch` when you do not know what you are looking for.
</Tip>

## Access levels

The same two OAuth scopes apply:

| Scope              | Grants                                                |
| ------------------ | ----------------------------------------------------- |
| `ontime:read`      | Read-only tools.                                      |
| `ontime:readwrite` | The full catalog, **intersected with your own role**. |

<Warning>
  Authorizing `ontime:readwrite` never grants more than you already have in the app. The scope is intersected with your employee role.
</Warning>

## Interactive views

OnTime's four interactive views are an MCP Apps feature. **ChatGPT renders them as text**, which is the designed fallback — the underlying data is identical.

## Revoking access

Remove the connector in ChatGPT, or revoke the token from the OnTime admin console. Revocation in OnTime takes effect immediately.

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 on every call">
    The token is missing, expired or revoked. Remove and re-add the connector to re-authorize.
  </Accordion>

  <Accordion title="Only search and fetch appear">
    Your credential's permissions are narrow, or you authorized `ontime:read`. Ask for `ontime_whoami` and compare against the [tool catalog](/ai-mcp/tool-catalog).
  </Accordion>

  <Accordion title="Writes are refused">
    Either you authorized the read-only scope, or your own role does not carry the permission. The scope is intersected with your role — widening the scope will not help if the role is the limit.
  </Accordion>
</AccordionGroup>

More in [Troubleshooting](/ai-mcp/troubleshooting).
