Raster
Guides

Using Raster from an AI agent

A runbook for LLMs and AI agents. Discover Raster, authenticate, and drive a library end to end over MCP or REST, with or without a Raster account.

An AI agent can use Raster to store, organize, search, and serve images on a person's behalf. This runbook covers how an agent finds Raster, gets a key, and runs the full asset loop: upload, tag, search, and hand off.

Where you start depends on what you hold:

  • If you already have an API key (the user pasted one, or your client is configured with it), go to Connect.
  • If you have no account and no key, start the user from zero with a single call. See Start without an account.

If you are driving a person's terminal and hold no key, sign in with the Raster CLI over OAuth. raster auth login opens a browser, captures the token, and stores it for you. raster whoami lists the organizations it reaches. See the CLI and MCP authentication.

Discover Raster

Raster publishes machine-readable discovery documents so a capable client can configure itself without hard-coded knowledge:

DocumentURLWhat it tells you
MCP server cardhttps://raster.app/.well-known/mcp.jsonThe MCP endpoint, transport, and auth scheme. Also at /.well-known/mcp/server-card.json.
Agent skills indexhttps://raster.app/.well-known/agent-skills/index.jsonSkills an agent can load, such as Markdown content negotiation.
API cataloghttps://raster.app/.well-known/api-catalogLinks to the API service and its documentation.
LLM page indexhttps://raster.app/llms.txtA Markdown index of every public page, plus pointers to these API docs.

Any marketing page under raster.app also returns a token-efficient Markdown version when you send Accept: text/markdown or append .md to the path. Docs pages under /docs answer only to the .md suffix. The Markdown negotiation skill describes it.

Connect

Pick the transport that matches your client.

Most agent platforms, including Claude, Cursor, VS Code, and the OpenAI Responses API, speak the Model Context Protocol. Point the client at the remote endpoint with an OAuth connection or a Bearer key, and Raster's tools appear in the palette:

https://mcp.raster.app/

The full per-client setup, the tool list, and runnable examples are on the MCP reference. Authentication and key scoping are covered in MCP authentication.

An API key is scoped to one organization and an allowlist of libraries, each at a read or write access level. Treat it like a password. Create and scope keys in organization settings. See Authentication.

Run the loop

Once connected, the working loop is the same on both transports. Each step names its MCP tool; the REST endpoint reference lists the matching operation under its REST name.

Resolve your scope

Call whoami (REST: GET /me) to get the organizationId and the library ids your credential can reach. A connection granted all your organizations returns organizations instead, one entry per organization; pick the one the user means. Calls on one library or its assets need an organizationId + libraryId pair; listing or creating libraries and searching take only the organizationId.

Read what is there

list_assets pages through a library. search_assets ranks results across libraries with highlights. list_tags returns a library's tags by usage. Use these to ground later actions in what already exists.

Add images

upload_asset takes a public http(s) URL the server fetches, or an inline base64 payload; upload_assets takes a batch in one call. An uploaded asset's CDN url serves as soon as the upload returns. The asset appears in lists and search a few seconds later.

Organize

tag_assets and update_asset_description make assets findable. transfer_assets moves them between libraries. delete_assets moves assets to trash (a recoverable soft delete).

Hand the result back

Each asset carries a permanent CDN url, the canonical link to the image. Return those URLs to the user, with the library URL, https://raster.app/<organizationId>/<libraryId>. If you started the user without an account, also give them the claim link so they can keep the work. See Start without an account.

Reusable prompts by use case

Each prompt below is a drop-in system-prompt block for one agent job: connecting, adding images, organizing, finding, or restructuring. Paste the one that matches the task. Together they cover the runbook above. Parameters and limits are on the linked tool reference.

Clients that load agent skills can fetch Raster's published raster-api skill from https://raster.app/.well-known/agent-skills/index.json, or install it into any coding agent with the skills CLI.

Each prompt has an MCP and a REST version. Pick a tab and the choice applies to every example. Run the loop links the reference behind each transport's names.

Connect with a key and resolve scope

Use when you already hold an API key (the user pasted one, or your client is configured with it) and need to discover the organization and libraries it can act on before any read or write.

When you hold a Raster API key and need to act on the user's images:

- Call `whoami` first. It returns the `organizationId` and the libraries your key can reach. Pair that `organizationId` with a `libraryId` on every asset-level call.
- When the user names a library or you need to choose one, call `list_libraries` for the org and match by name.
- Before acting on a library, call `list_assets` and `list_tags` to ground your work in what already exists.
- A library your key cannot reach returns 404. Treat that as out of scope and pick a library `whoami` listed.

Use when you have images to bring into a library (public URLs, local files, or a mix) and want them hosted on the CDN with shareable links back, without creating duplicates.

When you add images to a Raster library:

- Call `whoami` for the `organizationId` and a writable `libraryId`, then confirm the target library. For a connection granted all your organizations, `whoami` returns `organizations` instead; pick the one the user means.
- Upload with `upload_asset` for one image or `upload_assets` for a batch. Mix public http(s) URLs and base64 freely: pass a URL when you have one, base64 for local files. A batch checks every source before storing any file. A source that is malformed, cannot be fetched (an error status or a failed connection), points to a private network, or is base64 over the size limit fails the whole batch; fix it and resend. A file refused for its type, one that cannot be opened, or a URL source whose download passes the size limit is left out and named in `responseText` while the rest upload.
- Each upload returns the asset's permanent CDN `url` and `id` right away, and the image appears in lists and search a few seconds later. Re-list or re-search before concluding an upload failed.
- Hand the user each asset's permanent `url`, plus the library URL, `https://raster.app/<organizationId>/<libraryId>`.

Organize and curate — tag, describe, clean up

Use when images already live in a library and you need to make them findable or tidy them: apply or remove tags, write descriptions, or retire unwanted and duplicate assets.

When you organize assets in a Raster library:

- Call `list_tags` to reuse the library's existing vocabulary, then apply tags with `tag_assets`. Tagging is idempotent, and the reserved tags `index` and `trash` are rejected, so choose other words.
- Remove a label that no longer fits with `untag_assets`.
- Write a description with `update_asset_description`, which stores your text verbatim. Run your own model to generate it, then post the result, and pass an empty string to clear it.
- Use `get_asset` to read one asset's current `url`, `tags`, and `description` before changing it.
- To curate duplicates, find matches with `search_assets`, keep the canonical asset, and move the rest to trash with `delete_assets`. This soft delete stays recoverable from trash until it is permanently removed.
- Every asset you tag, untag, or describe must belong to the named library, or the call fails as a whole before changing anything. `delete_assets` skips ids that are not in the library; if none of them match, the call fails.

Use when the user wants you to find specific images across one library or many and hand back usable links for a page, an email, a doc, or a content slot. These calls are read-only.

When you find and return images from Raster:

- Call `whoami` for the `organizationId` and the libraries your credential can reach. For a connection granted all your organizations, `whoami` returns `organizations` instead; pick the one the user means.
- Use `search_assets` for free-text queries across every authorized library; it matches name, description, and tags and returns ranked hits with highlights. Pass `libraries[]` to narrow to a named subset, and use an empty query to get recent assets.
- Use `list_assets` to page through one library, filtering by a set of tags; call `list_tags` first to learn which tags exist.
- Use `get_asset` to fetch one asset's full detail by `id` without paging.
- Return each match's permanent `url`, with its tags and description as context, plus the library URL, `https://raster.app/<organizationId>/<libraryId>`.
- A freshly uploaded image becomes searchable a few seconds after upload, so re-search if a recent one is missing.

Restructure libraries and move assets

Use when you need to change library structure: create a new library for a project or campaign, rename one, or move assets between libraries in the same organization.

When you restructure a user's Raster libraries:

- Call `whoami` for the `organizationId`. For a connection granted all your organizations, `whoami` returns `organizations` instead; pick the one the user means. Then call `list_libraries` to see what already exists before creating anything.
- Create a library with `create_library` (name required, optional slug). It joins your key's allowlist, so you can upload to it right away.
- Rename a library with `rename_library`; the name updates everywhere it is shown and the URL slug stays the same, so existing links keep working.
- Move assets within the same org with `transfer_assets`: name the `sourceLibraryId`, the `targetLibraryId`, and the asset `id`s. Every `id` must already live in the source library, or the call fails as a whole.
- After creating, renaming, or moving, re-run `list_libraries` (and `list_assets` where relevant) to confirm the new state, and report each library's name and URL, `https://raster.app/<organizationId>/<libraryId>`, back to the user.

Start from zero — no account, no key

Use when the user has no Raster account and you hold no API key. The dedicated flow mints an organization, a starter library, and a key, then hands off a claim link. Its prompt is in Start without an account.

Where to go next

On this page