> ## Documentation Index
> Fetch the complete documentation index at: https://glide-9da73dea.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript quickstart

> Run the TypeScript accounts.list example with an authorized Glide grant.

The TypeScript example calls `accounts.list` and prints the authorized accounts. It uses a fetch wrapper in `src/glide-client.ts`. It does not mint a grant, refresh tokens, stream events or initiate a payment.

## Prerequisites

Use the product repository with its dependencies installed, Node with native fetch support, and a configured MCP gateway. Obtain an active grant with `accounts:read` through your authorization server.

## Run the example

Set `GLIDE_GRANT_TOKEN` and, if needed, `GLIDE_BASE_URL` in your environment. From the product repository root:

```bash theme={null}
pnpm --filter @glide-examples/typescript-quickstart start
```

The entry point is `src/index.ts`. It exits with an error if the token is missing or the API call fails. On success, it prints the account list and fetch timestamp.

## Use the wrapper

This example's wrapper accepts the tool name, arguments and an optional category. The default category is `read`.

```ts theme={null}
import { GlideClient } from './glide-client.js';

const client = new GlideClient({
  grantToken: process.env.GLIDE_GRANT_TOKEN!,
  baseUrl: process.env.GLIDE_BASE_URL,
});
const result = await client.call('accounts.list', {});
console.log(result);
```

The wrapper unwraps MCP `result.structuredContent` and rejects HTTP, JSON-RPC and tool errors. Token renewal is the caller's responsibility.

## Extend it

Choose a tool exposed by your gateway and use its required scope, input schema and category. For writes, handle approval responses and track the existing action before retrying. Start with [payment simulation](https://glide-9da73dea.mintlify.site/agents/api/payments-simulate.md).

## Source

[Read the TypeScript example](https://github.com/glide-co/glide-mono/tree/main/examples/typescript-quickstart). Source access is required.

## Next

* [MCP tool reference](https://glide-9da73dea.mintlify.site/agents/api/index.md)
* [OAuth flow](https://glide-9da73dea.mintlify.site/oss/headless/oauth-flow.md)
* [Agent pays vendor](https://glide-9da73dea.mintlify.site/cookbook/agent-pays-vendor.md)


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