Skip to main content
Glama

attach

Connect to a local JVM by PID or a JVM inside a Docker container to record CPU, JDBC, JPA, HTTP, and MongoDB performance data until recording is halted.

Instructions

Attach to a running JVM by PID or to a JVM inside a Docker container. Records performance data for the following subsystems: cpu, jdbc, jpa, http_server, http_client, mongo_db until check_status is called with 'stopRecording: true'. You can use list_jvms to discover JVMs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNoThe PID of a local JVM process, or the container PID (NSpid) of a JVM inside the specified container. If a container is specified and this is omitted, the topmost JVM in the container is used.
containerNameOrIdNoThe name or ID of a Docker container. When specified, profiling attaches to a JVM inside this container.
Behavior3/5

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

No annotations provided, so the description bears full burden. It discloses that recording continues until check_status with 'stopRecording: true', and lists subsystems. However, it omits behavior when no parameters are given (no pid or container), return values, and any side effects or safety considerations.

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?

The description is two sentences, front-loaded with the core purpose, and contains no redundant or unnecessary words. Every sentence adds essential information.

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?

Given no output schema, the description should explain what the tool returns upon success or failure; it does not. It covers the main workflow but omits edge cases (e.g., no JVM found, permissions) and any indication of the data format or how to access recorded data beyond check_status.

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

Parameters4/5

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

Schema coverage is 100% with good parameter descriptions. The description adds value beyond schema by explaining the two attach methods (local PID vs container), the container PID concept, and the default behavior when container specified without pid. This surpasses the baseline of 3.

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 clearly states the tool attaches to a JVM and records performance data for specific subsystems. It names the resource (JVM) and action (attach), but does not explicitly differentiate from all sibling tools like create_heap_dump or get_heap_data, though mentioning check_status provides some context.

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?

The description implies usage for starting a recording and suggests using list_jvms first, but provides no explicit when-to-use or when-not-to-use guidance. It does not mention alternatives or exclusions, making it minimally adequate.

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/ej-technologies/jprofiler-mcp'

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