Skip to main content
Glama
bmorphism

Penumbra MCP Server

get_dex_state

Retrieve the current decentralized exchange (DEX) state, including the latest batch auction results, using the Penumbra MCP Server. Enables privacy-preserving insights into DEX activities.

Instructions

Get current DEX state including latest batch auction results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function implementing the logic for the 'get_dex_state' tool. It returns the current DEX state including batch information and active pairs (using mock data).
    private async getDexState() {
      try {
        // TODO: Implement actual DEX state query
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                currentBatchNumber: "12345",
                lastBatchTimestamp: new Date().toISOString(),
                batchInterval: CONFIG.dex.batchInterval,
                minLiquidityAmount: CONFIG.dex.minLiquidityAmount,
                maxPriceImpact: CONFIG.dex.maxPriceImpact,
                activePairs: [
                  {
                    baseAsset: "penumbra/usdc",
                    quoteAsset: "penumbra/eth",
                    lastPrice: "1850.50",
                    volume24h: "1000000"
                  }
                ]
              }, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching DEX state: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
  • src/index.ts:127-135 (registration)
    Registration of the 'get_dex_state' tool in the ListTools handler, specifying name, description, and empty input schema.
    {
      name: 'get_dex_state',
      description: 'Get current DEX state including latest batch auction results',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/index.ts:169-170 (registration)
    Registration/dispatcher case in the CallToolRequest handler that routes calls to the getDexState() method.
    case 'get_dex_state':
      return await this.getDexState();
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't specify whether it requires authentication, has rate limits, or what format the results are in. This leaves significant gaps for a tool with zero annotation coverage.

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 a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for a zero-parameter tool and earns its place by clearly stating what the tool does.

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 the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It explains what data is retrieved but doesn't cover behavioral aspects like authentication or result format, making it minimally viable for this context.

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?

The tool has 0 parameters, and the schema description coverage is 100%, so there's no need for parameter documentation in the description. The baseline for this scenario is 4, as the description appropriately avoids redundant parameter details.

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's purpose with a specific verb ('Get') and resource ('current DEX state including latest batch auction results'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like get_chain_status or get_governance_proposals, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like get_chain_status or get_transaction. It lacks explicit context about use cases, prerequisites, or exclusions, leaving the agent to infer usage based on the tool name alone.

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

Related 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/bmorphism/penumbra-mcp'

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