Skip to main content
Glama

Create Canvas

javafx_init_canvas

Create an off-screen JavaFX canvas with specified width and height to enable headless rendering and image generation.

Instructions

Create an off-screen JavaFX canvas with the given width and height.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "javafx_init_canvas"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthNoCanvas width in pixels (default: 800)
heightNoCanvas height in pixels (default: 600)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare this is a non-readonly, non-idempotent, non-destructive, closed-world operation, so the safety profile is covered. The description adds the useful detail that the canvas is off-screen, but says nothing about what identity or handle is returned, whether calling it again replaces an existing canvas, or what happens at the 16384-pixel limits.

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

Conciseness5/5

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

One front-loaded sentence with no filler; the resource and its qualifying dimensions come first and nothing is repeated unnecessarily.

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?

For a simple two-parameter creation tool with full schema coverage and annotations, this is nearly adequate. The remaining gap is practical: without an output schema, the description should indicate what reference to the new canvas is produced so the agent knows how to pass it to javafx_draw_canvas or javafx_export_image.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already documents both width and height including defaults of 800 and 600 and the 1–16384 bounds. The description only restates that these parameters exist, adding no format or unit information beyond the schema, so the baseline of 3 applies.

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

Purpose4/5

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

The description pairs a specific verb ('Create') with a specific resource ('an off-screen JavaFX canvas') plus its dimensions, so it is clearly distinguishable from javafx_clear_canvas and javafx_draw_canvas. It stops short of naming any sibling explicitly, but the operation is unambiguous.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the setup step before drawing or exporting, but the description never says when to call it versus the clear/draw siblings, nor whether it should be called once per session or per drawing.

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