Skip to main content
Glama
theSharque
by theSharque

analyze_threads

Analyze thread dumps from a Java process to identify lock contention and deadlocks, optionally returning structured JSON for lock-wait chains.

Instructions

Thread dump (jstack -l). Default: plain text. Set structured=true for JSON lock-wait chains (live snapshot). Historical contention: profile_jfr_locks. Deadlock cycle: check_deadlock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesProcess ID of the Java application. Get this from list_java_processes.
topNNoMaximum number of threads to include in the output. Default: 10. Increase for applications with many threads.
structuredNoReturn structured JSON with lockWaitChains instead of plain-text dump. Default: false.
Behavior4/5

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

While no annotations are provided, the description discloses key behaviors: it produces a thread dump, outputs plain text by default or structured JSON for lock-wait chains (described as a 'live snapshot'), and implies it is a read-only diagnostic operation. It does not contradict any annotations (none exist) and provides sufficient behavioral context for safe invocation.

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 exceptionally concise and front-loaded: the first sentence immediately states the tool's core function ('Thread dump (jstack -l)'). Every subsequent sentence adds essential information without filler, fitting all key details into four short sentences.

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

Completeness5/5

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

Despite the absence of an output schema, the description clearly explains the two output formats (plain text and JSON with lock-wait chains) and their purposes. It also provides cross-references to related tools for related use cases, making the description self-contained and complete for an agent to use.

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%, providing baseline descriptions for all three parameters (pid, topN, structured). The description adds value by explaining how parameters affect output (e.g., 'structured=true for JSON lock-wait chains') and giving context for pid ('Get this from list_java_processes'), going beyond what the schema alone 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 it performs a thread dump (jstack -l), distinguishing between plain text and structured JSON output. It also explicitly contrasts with sibling tools for historical contention (profile_jfr_locks) and deadlock detection (check_deadlock), making its 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 Guidelines5/5

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

The description provides explicit guidance on when to use this tool (for thread dumps), when to set structured=true (for JSON lock-wait chains), and directs users to alternative tools for historical contention (profile_jfr_locks) and deadlock cycles (check_deadlock), helping agents choose correctly.

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/theSharque/mcp-jperf'

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