---
title: "Preview an import of tool definitions from an OpenAPI spec or connector YAML manifest."
method: POST
path: "/tools/import"
tags: ["tools"]
---

# Preview an import of tool definitions from an OpenAPI spec or connector YAML manifest.

`POST /tools/import`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/tools/import`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`
  - API key in cookie `mnemom_session`

Parses the spec, extracts tool definitions, and optionally calls the LLM to infer class+domain. **Never auto-commits** — the caller iterates the `imported[]` array and writes each tool individually via `POST /v1/tools`. Platform-admin only. SSRF-defended (localhost / link-local / RFC-1918 blocked).

## Request body

- object
  - `format` 'openapi' | 'connector_yaml', required
  - `source` 'inline' | 'url', required
  - `content` string: Raw spec text. Required when `source=inline`.
  - `url` string: Public URL to fetch the spec. Required when `source=url`.
  - `infer_class_domain` boolean: When true (default), calls the LLM to infer class + domain per tool.

## Response `200`

Preview of the imported tool definitions.

- object
  - `ok` true, required
  - `imported` object[], required
  - `inferred_class_domain` object, required
  - `conflicts` object[], required
  - `commit_url` string, required
  - `preview_token` string, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `413`: Request body exceeded the per-endpoint size cap. Cards-as-primitive sub-resource verbs cap each primitive body at 64 KiB; full-card PUTs cap at 128 KiB (alignment) / 64 KiB (protection).
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `502`: An upstream dependency returned an invalid response.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
