Skip to main content
Glama

apply_to_layers

Apply property changes (visible, opacity, colormap, etc.) to layers filtered by type or name pattern.

Instructions

Apply property changes to multiple layers matching a filter.

Parameters

filter_type : str, optional Layer type name to match (e.g., "Image", "Labels", "Points"). filter_pattern : str, optional Glob pattern matched against layer names (e.g., "seg_*"). properties : dict, optional Properties to set on matched layers. Supported keys: visible, opacity, colormap, blending, contrast_limits, gamma, new_name (renames by appending a suffix is NOT supported — use set_layer_properties individually).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_typeNo
filter_patternNo
propertiesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description discloses supported properties (visible, opacity, colormap, etc.) and a crucial limitation: renaming via suffix is NOT supported. This helps the agent understand the tool's capability and avoids unexpected failures. Since no annotations are provided, the description carries the full burden, and it does well in revealing constraints.

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?

The description is structured with a concise opening sentence followed by a clear parameter list. It is informative without being overly verbose. A minor point is that it could be slightly more compact, but the level of detail is appropriate given the lack of schema descriptions.

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

Completeness4/5

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

Given the tool's complexity (3 optional parameters) and the presence of an output schema, the description adequately covers the tool's purpose, parameters, and a key limitation. It does not mention what happens when no layers match or error conditions, but these may be covered by the output schema. Overall, it provides sufficient context for correct invocation.

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?

Schema coverage is 0%, so the description fully explains each parameter: filter_type (layer type name like 'Image'), filter_pattern (glob pattern like 'seg_*'), and properties (dict with specific keys and examples). This adds significant meaning beyond the schema's minimal title fields, enabling proper usage.

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 the tool applies property changes to multiple layers matching a filter. It specifies the action (apply), the resource (property changes), the target (multiple layers), and the selection mechanism (filter). This purpose distinguishes it from siblings like set_layer_properties, which is for individual layer operations.

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

Usage Guidelines4/5

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

The description provides guidance on when not to use this tool: it states that renaming by appending a suffix is not supported and directs to use set_layer_properties individually for that. This implicitly tells the agent to use this tool for bulk property changes other than suffix renaming. However, it does not explicitly list all alternative tools or scenarios.

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