Skip to main content
Glama

AskHook

Hook permission flags

hook_flags
Read-only

Turn a list of Uniswap v4 hook permissions into the address flag mask a hook must be deployed at (mine a CREATE2 salt until address & 0x3fff == mask), or check whether an address matches.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "permissions": "<permissions>"
    },
    "name": "hook_flags"
  }
}

Input Schema

NameRequiredDescriptionDefault
addressNoOptional: a candidate address to check against the mask
permissionsYesAny of: beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeDonate, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish read-only/open-world behavior, and the description adds the crucial bitmask rule and CREATE2 salt-mining condition. It stops short of stating computational cost or whether salt mining is actually performed versus merely explained, but it adds substantive behavior beyond the annotations.

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 definition is a single front-loaded sentence with an essential parenthetical; every clause carries purpose or behavior. It is dense but not bloated.

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?

For a low-complexity two-parameter tool with full schema coverage and safety annotations, the description covers both modes and the mask condition. The main minor gap is that return values are only implied, especially in the parenthetical about salt mining, since no output schema exists.

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%, so the baseline is 3; the description adds domain meaning by tying `permissions` to Uniswap v4 hook flags and `address` to a mask-check candidate. It does not map individual permission names to bit positions, but that is reasonably left to the enum and domain logic.

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 states two specific operations—converting Uniswap v4 hook permissions into an address flag mask and checking an address against that mask—with the exact bit condition `address & 0x3fff == mask`. This distinguishes it from sibling hook-information tools by being a computation/check rather than a lookup.

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?

It makes the two use cases clear: provide `permissions` to derive the deployment mask, or provide `address` to check a candidate. It does not explicitly route against sibling tools or state exclusions, but the context is clear enough.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources