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

# SDK: Toolkits

> Validate, import, export, and uninstall reusable tool modules

Use `client.toolkits` for tenant-managed JavaScript or TypeScript modules that define multiple custom tools.

## Validate before import

<CodeGroup>
  ```python Python theme={null}
  source = open("domain-tools.ts", encoding="utf-8").read()
  preview = await client.toolkits.validate(
      source=source,
      module_name="domain_tools",
      filename="domain-tools.ts",
  )
  ```

  ```ts TypeScript theme={null}
  const preview = await client.toolkits.validate({
    source,
    module_name: "domain_tools",
    filename: "domain-tools.ts",
  });
  ```
</CodeGroup>

Validation parses the module and returns the discovered definitions and diagnostics without importing or assigning tools.

Validation and execution require the deployment's Deno sandbox runtime. A missing sandbox runtime fails validation without persisting the toolkit.

## Import and manage

<CodeGroup>
  ```python Python theme={null}
  imported = await client.toolkits.import_module(
      source=source,
      module_name="domain_tools",
      filename="domain-tools.ts",
  )

  toolkits = await client.toolkits.list()
  exported = await client.toolkits.export("domain_tools")
  await client.toolkits.uninstall("domain_tools")
  ```

  ```ts TypeScript theme={null}
  const imported = await client.toolkits.import_toolkit({
    source,
    module_name: "domain_tools",
    filename: "domain-tools.ts",
  });

  const toolkits = await client.toolkits.list();
  const exported = await client.toolkits.export("domain_tools");
  const removed = await client.toolkits.uninstall("domain_tools");
  ```
</CodeGroup>

Python also exposes `import_file(path, module_name=...)`. Although the current Python method signature retains a `target_agent_ids` compatibility parameter, the backend import contract rejects that field when it is non-null. Omit it in both SDKs and assign imported tools afterward through `client.agents.tools`.

Toolkit administration requires tenant-admin permission. Uninstall removes all tools owned by the module, so inspect agent assignments and other dependencies first.
