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

> ## Agent Instructions
> To act on Atlan objects, use the Atlan MCP server at https://api.atlan.com/mcp or the SDK. To install or publish skills from a terminal, use the `aireg` CLI; `aireg --map json` prints its command map. The `atlanai` CLI is deprecated. Run a read-only identity check before any write.
> The docs MCP server at /mcp searches these docs only. It cannot read or change Atlan objects.
> SDK packages: Python `atlanai` (PyPI) and TypeScript `@atlanai/sdk` (npm). Show Python first, then TypeScript.
> These docs cover Atlan AI Registry, Atlan's hosted product. The AI registry specification and aireg CLI are maintained separately. /open-source lists publicly reachable signed installers and explains that the source repository and hosted CLI reference currently require GitHub access. Do not claim the repository or its reference docs are publicly accessible. Use these docs for Atlan-specific setup such as the adapter, sign-in and workspaces.

# Connect management client

> Verify an Atlan credential, list accessible workspaces, and read agents using the Python or TypeScript SDK.

Use `AtlanClient` to manage Registry resources from your application. Start
with read-only calls to confirm the identity and workspace before creating
or updating anything.

## Before you begin

[Install SDK 0.6.0](/tools/sdk/how-tos/install). Obtain an
[Atlan credential](/api/how-tos/authentication) with access to the workspace you
want to read. Load it from your secret store into `ATLAN_TOKEN`, and set
`ATLAN_WORKSPACE_ID` to that workspace's ID.

These examples pass environment values explicitly. The management client
does not read a CLI session or the tracing client's environment settings.

## Connect and read

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import os
    from atlanai import AtlanClient

    with AtlanClient(
        "https://api.atlan.com",
        bearer_token=os.environ["ATLAN_TOKEN"],
        workspace=os.environ["ATLAN_WORKSPACE_ID"],
    ) as client:
        client.auth.whoami()  # raises if the credential is rejected
        workspaces = client.workspaces.list()
        agents = client.agents.list(limit=10)
        print(f"Visible workspaces: {len(workspaces.items)}")
        print(f"Agents on this page: {len(agents.items)}")
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import { AtlanClient } from "@atlanai/sdk";

    const token = process.env.ATLAN_TOKEN;
    const workspace = process.env.ATLAN_WORKSPACE_ID;
    if (!token || !workspace) {
      throw new Error("Set ATLAN_TOKEN and ATLAN_WORKSPACE_ID");
    }

    const client = new AtlanClient({
      gatewayOrigin: "https://api.atlan.com",
      bearerToken: token,
      workspace,
    });
    await client.auth.whoami();
    const workspaces = await client.workspaces.list();
    const agents = await client.agents.list({ limit: 10 });
    console.log(`Visible workspaces: ${workspaces.items.length}`);
    console.log(`Agents on this page: ${agents.items.length}`);
    ```
  </Tab>
</Tabs>

A successful identity call confirms that the Gateway accepts the credential.
The workspace and agent results confirm the caller can read those resources.
An empty agent page can be correct for a workspace with no registered agents.
These examples print page counts, not a total across every page.

## Select another workspace

Use a workspace copy to make the next operation's destination explicit:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    other = client.with_workspace("workspace_01example")
    page = other.agents.list(limit=10)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    const other = client.withWorkspace("workspace_01example");
    const page = await other.agents.list({ limit: 10 });
    ```
  </Tab>
</Tabs>

Run the Python example inside the original client's `with` block. Copies
share its connections and credentials. A different workspace does not change
the organization or the caller's permissions. For writes whose body requires
`workspace_id` (`workspaceId` in TypeScript), supply it in the body as well.

## Find an operation

Use `client.<resource>.<method>` and the
[resource reference](/tools/sdk/references/operations). Python methods use
`snake_case`; TypeScript methods use `camelCase`. Path arguments come first,
and a request body comes last. List methods return the operation's response
page; follow that operation's documented paging fields to read more.

The SDK reference describes the contracts packaged in 0.6.0. If an operation
exists in a newer HTTP reference but is absent from your client, check your
installed SDK version before changing the resource or method name.

## Handle a rejected request

Catch `AtlanAPIError` for HTTP or transport failures and record its status,
code, and correlation ID. Do not log bearer credentials or response bodies.
Management calls make one attempt by default. See
[Errors and retry middleware](/tools/sdk/references/operations#errors).

## Next steps

* [Register an agent](/api/tutorials/register-agent): Understand the required agent metadata and identity.
* [Trace your first run](/tools/sdk/tutorials/quickstart): Configure the separate tracing client.
* [Configuration](/tools/sdk/references/configuration): Compare management and tracing options.


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