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

# registerMentions

> Let users at-mention your app's items in the ChatGPT composer

> [!NOTE]
>
> This is an [OpenAI MCP extension](https://github.com/openai/mcp-extensions/blob/main/docs/spec.md), not part of MCP or MCP Apps. Only **ChatGPT** supports it, and other hosts ignore it.

By default, users can only at-mention your app as a whole. `registerMentions` lets them mention individual items, such as parts, files or people: when the user types `@` and your app, ChatGPT calls your handler with the text typed so far and lists the items it returns. ChatGPT desktop only.

## Example

A parts catalog lets the user mention a part by name.

```ts theme={null}
server.registerMentions({
  name: "search_parts",
  handler: async ({ query }) => ({
    items: (await findParts(query)).map((part) => ({
      type: "resource_link",
      uri: `parts://${part.id}`,
      name: part.name,
    })),
  }),
});
```

## Parameters

### `config`

```ts theme={null}
type OpenAIMentionsConfig = {
  name: string;
  description?: string;
  handler: (
    params: { query: string },
    extra: ToolHandlerExtra,
  ) => { items: ResourceLink[] } | Promise<{ items: ResourceLink[] }>;
};
```

| Field | Purpose |
| - | - |
| `name` | Name of the tool ChatGPT calls for each search. |
| `description` | Tool description. Defaults to a generic one, since the model never sees this tool. |
| `handler` | Receives the typed text as `query`, which may be empty, and returns the matching items as MCP resource links. `extra` is the same as in a [`registerTool`](/api-reference/register-tool) handler. |

## How it works

Skybridge registers a tool named `name` that takes `{ query: string }` and returns `{ items }` as `structuredContent`. Its `_meta` carries `"openai/extensions": { "mentions/search": {} }`, which tells ChatGPT it serves mentions, and `ui.visibility: ["app"]`, which hides it from the model. It requires sign-in like any other tool on a server with [`oauth`](/api-reference/skybridge#oauth).

Returns the server, so calls chain.

## Serve the mentioned items

When the user picks an item, its resource link goes into the message, so the model gets the `uri` rather than the item itself. Serve those URIs as MCP resources so the host can read them:

```ts theme={null}
import { ResourceTemplate } from "skybridge/server";

server.registerResource(
  "part",
  new ResourceTemplate("parts://{id}", { list: undefined }),
  { mimeType: "application/json" },
  async (uri, { id }) => ({
    contents: [{ uri: uri.href, text: JSON.stringify(await getPart(String(id))) }],
  }),
);
```

> **[registerTool](/api-reference/register-tool.md)**
>
> Register tools and their ChatGPT entrypoints

> **[McpServer](/api-reference/mcp-server.md)**
>
> Every method of the server


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.