Skip to main content
Glama

add_layer

Add image, labels, points, shapes, vectors, tracks, or surface layers to a napari viewer using file paths or inline data, with options for colormap, blending, size, and colors.

Instructions

Add a layer to the viewer.

Parameters

layer_type : str One of: "image", "labels", "points", "shapes", "vectors", "tracks", "surface". path : str, optional File path (for image/labels). data : list, optional Inline data (coordinates, shape vertices, etc.). data_var : str, optional Name of a variable in the execute_code namespace. name : str, optional Layer name. Defaults to variable name or filename. colormap : str, optional Colormap name (image only). blending : str, optional Blending mode (image only). channel_axis : int, optional Channel axis (image only). size : float, optional Point size in pixels (points only, default 10). shape_type : str, optional Shape type: "rectangle", "ellipse", "line", "path", "polygon" (shapes only, default "rectangle"). edge_color : str, optional Edge color (shapes/vectors only). face_color : str, optional Face color (shapes only). edge_width : float, optional Edge width in pixels (shapes/vectors only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layer_typeYes
pathNo
dataNo
data_varNo
nameNo
colormapNo
blendingNo
channel_axisNo
sizeNo
shape_typeNo
edge_colorNo
face_colorNo
edge_widthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the transparency burden. It reveals the tool is a mutation (adds layers) and details parameter behaviors, but it does not explicitly state side effects (e.g., whether it stacks layers, requires viewer initialization, or has order dependencies).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with a one-line purpose followed by a clear bullet-style parameter list. While lengthy due to 13 parameters, every item adds value and is front-loaded. Some redundancy could be trimmed (e.g., repeating defaults).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Parameter documentation is thorough, but missing high-level context such as when to use, prerequisites (e.g., viewer must be initialized), or expected output behavior. The output schema exists but is not referenced; description could briefly mention return type.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema coverage, the description provides exhaustive parameter details: allowed values, defaults, and context for each parameter (e.g., layer_type enums, colormap caveat 'image only', shape_type options). This far surpasses the baseline compensation needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Add a layer to the viewer' with a specific verb and resource. It distinguishes from sibling tools like remove_layer, set_layer_properties, and list_layers, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., init_viewer, set_layer_properties). The description only lists parameters without context on prerequisites or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/royerlab/napari-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server