# agentbrush_generate

Generate an image from a text description. Use when the user or project needs a new image asset. Presets: - realistic: Realistic (single model) - flat_illustration: Flat Illustration (single model) - pixel_art: Pixel Art (single model) - isometric: Isometric (single model) - logo: Logo (single model) - custom: Custom (single model) Quality levels (quality_hint): low=1 token, medium=5 tokens (default), high=20 tokens — at 1024×1024. Multiplied by a resolution factor for other sizes (portrait 0.8×, landscape 0.95×). Size: 1024x1024 (square), 1024x1536 (portrait), 1536x1024 (landscape), or a { width, height } custom object. Format: png (lossless, transparency), jpeg (smaller), webp (modern, transparency). Background: opaque or auto. For transparent backgrounds, generate with opaque and call agentbrush_remove_background on the result. style_context: optional { style_descriptor?, color_hints?, mood_tags? }. Auto-filled from .agentbrush/identity.json when omitted; explicit values override the file. reference_image_paths: optional absolute paths to reference images (max 10). When supplied, the backend routes the generation to OpenAI /v1/images/edits with the references attached as image[] parts — the model uses them as the appearance/style authority and composes the new image per the subject prompt. Paths must resolve inside .agentbrush/references/; obtain them via agentbrush_list_references or register a generated image as a reference via agentbrush_save_as_reference. Character iteration workflow: generate a character once with agentbrush_generate, optionally polish it via agentbrush_edit_mask, save it with agentbrush_save_as_reference, then every subsequent agentbrush_generate call can pass the reference path to keep the character consistent across new scenes/poses. output_dir: directory to save the image (default: ./public/images/). Relative to project root. Returns: saved file path, generation metadata, token cost, remaining balance, and an inline image preview.

Agent View of the PolicyLayer registry record for `agentbrush_generate`. HTML page: https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-generate

## Facts

- Tool: `agentbrush_generate`
- Server: Mcp Server (`@agentbrush/mcp-server`) — https://policylayer.com/tools/dev-agentbrush-mcp-server.md
- Install: `npx -y @agentbrush/mcp-server`
- Homepage: https://www.npmjs.com/package/@agentbrush/mcp-server
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 9 (1 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `size` | object | no | Image dimensions. Options: 1024x1024 (square), 1024x1536 (portrait), 1536x1024 (landscape), or { width, height } custom object. |
| `preset` | string | no | Visual style preset. Options: realistic (photorealistic), flat_illustration (vector-like), pixel_art (retro pixel), isometric (3D isometric), logo (brand marks) |
| `subject` | string | yes | Description of the image to generate |
| `background` | string | no | Background type. Options: opaque, auto. To get a transparent background, generate with opaque and then call agentbrush_remove_background. |
| `output_dir` | string | no | Directory to save the generated image. Relative paths resolve from project root (process.cwd()). Defaults to ./public/images/ |
| `quality_hint` | string | no | low: 1 token at 1024×1024 (fast iteration). medium: 5 tokens (default). high: 20 tokens (best quality). Multiplied by a resolution factor for non-square sizes. |
| `output_format` | string | no | Output file format. Options: png (lossless, supports transparency), jpeg (smaller, no transparency), webp (modern, supports transparency) |
| `style_context` | object | no | Optional brand context: { style_descriptor?: string, color_hints?: string[], mood_tags?: string[] }. When omitted, auto-filled from .agentbrush/identity.json vi |
| `reference_image_paths` | array | no | Local absolute paths to reference images selected via agentbrush_list_references. Each path must resolve inside .agentbrush/references/ (enforced at tool runtim |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "agentbrush_generate",
    "arguments": {
      "subject": "<subject>"
    }
  }
}
```

## Why agentbrush_generate is rated Medium

This tool creates new image assets from text descriptions. It is a Write operation — it produces new content but does not delete or irreversibly overwrite existing data, execute code, or involve financial transactions. Misuse could result in generation of off-brand or inappropriate image assets, giving it medium severity.

From the tool's own definition: "Generate an image from a text description. Use when the user or project needs a new image asset."

Risk signals: High parameter count (12 properties) · Bulk/mass operation — affects multiple targets · Admin/system-level operation

## Use case

AI agents use agentbrush_generate to create or update resources in Mcp Server, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Mcp Server environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Mcp Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "agentbrush_generate": {
      "limits": [
        {
          "counter": "agentbrush_generate_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Mcp Server (11)

- `agentbrush_remove_background` — Destructive — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-remove-background.md
- `agentbrush_edit_mask` — Execute — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask.md
- `agentbrush_edit_mask_open` — Execute — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask-open.md
- `agentbrush_check_status` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-check-status.md
- `agentbrush_list_presets` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-list-presets.md
- `agentbrush_list_references` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-list-references.md
- `agentbrush_edit_mask_result` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask-result.md
- `agentbrush_init` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-init.md
- `agentbrush_login` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-login.md
- `agentbrush_populate_identity` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-populate-identity.md
- `agentbrush_save_as_reference` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-save-as-reference.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=dev-agentbrush-mcp-server · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dev-agentbrush-mcp-server
