Skip to main content
Glama

attach

Record performance data from a running JVM by attaching via PID or Docker container. Monitors CPU, JDBC, JPA, HTTP, and MongoDB subsystems until recording is stopped.

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?

With no annotations provided, the description carries the full burden. It discloses that the tool attaches and records data, but does not mention side effects, permissions, or whether the operation is blocking. The recording subsystems are listed, which adds value, but lacks details on data retrieval or error conditions.

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 very concise, consisting of two sentences plus a helpful tip. It front-loads the core purpose and immediately follows with key details, making it easy to parse.

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 lack of annotations and output schema, the description provides a solid overview of what the tool does, including the subsystems recorded and how to stop recording. It references other tools for discovery and stopping. However, it could include more about error handling or post-recording steps.

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?

The input schema already has 100% coverage with detailed descriptions for both parameters. The tool description adds context about the relationship between container and PID (e.g., container PID usage), but this is minimal additional value beyond what the schema provides.

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 attaches to a JVM by PID or within a Docker container and records performance data for specific subsystems. The verb 'Attach' is specific and the resource (running JVM) is well-defined, distinguishing it from sibling tools like list_jvms or check_status.

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 context on when to use the tool: it mentions using list_jvms to discover JVMs before attaching and that recordings continue until check_status is called with stopRecording. However, it does not explicitly state when not to use the tool or mention alternatives for other scenarios (e.g., heap dump).

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