Tools reference¶
The server registers 11 MCP tools against the MCPServer
instance. Every tool is async and reads its dependencies (the
NovelAIClient and NovelAISettings) from the MCP request context’s
lifespan state.
Tool index¶
Tool |
Group |
Description |
|---|---|---|
generation |
Text-to-image (V3 / V4 / V4.5, character prompts, vibes) |
|
generation |
Image-to-image with strength / noise |
|
generation |
Local redraw (requires inpaint model + mask) |
|
enhance |
2× / 4× upscaling |
|
enhance |
line art / sketch / bg-removal / declutter / colorize / emotion |
|
enhance |
ControlNet preprocessing (hed, midas, scribble, mlsd, uniformer) |
|
tags |
Prompt tag suggestions |
|
tags |
Encode a reference image into a vibe token |
|
account |
Account subscription + Anlas balance |
|
account |
Account user data |
|
account |
Estimate Anlas cost without an API call |
Common patterns¶
Return shape¶
Every image-producing tool returns a list of MCP content blocks:
[
Image(data=b"...png bytes...", format="png"), # agent sees the image
f"Saved 1 image(s): ['outputs/generate-...png']" # text path for follow-up
]
The agent can either inspect the image inline (base64 Image block) or read
the path from the text block to pass to a subsequent tool.
Image parameters¶
Image parameters that take a str (image, mask, reference,
references) expect base64-encoded PNG or JPEG strings, not file paths.
To convert a local file:
import base64
from pathlib import Path
image_b64 = base64.b64encode(Path("input.png").read_bytes()).decode("ascii")
The CLI handles this automatically — it accepts file paths via --image ./input.png.
Validation¶
Tools validate inputs eagerly and raise ValueError with a list of valid
options when an enum-style parameter (model, tool, emotion,
controlnet model, action) doesn’t match. The MCP runtime surfaces these
as tool-call errors that the agent can read and self-correct from.
Per-tool pages¶
See also¶
Tutorials — end-to-end workflows combining tools
API reference — autodoc for the underlying
NovelAIClientConfiguration — defaults applied when a parameter is omitted