Skip to main content
Glama
KaiSign MCP Server

KaiSign MCP Server

Official
by Kai-Sign

get_function_selectors

Resolve canonical ABI signatures and selectors for an exact contract address and chain ID before encoding calldata, preventing guessed or reused selectors from model memory.

Instructions

Auxiliary to clear_sign_payload: resolve function selectors from KaiSign local metadata for an exact contract address + chainId (anti-hallucination — never guess selectors from model memory).

Builder UX rule: when a user gives only lightweight input like chainId, contracts, and actions (for example "approve 1000 USDC" and "transfer 10 USDC"), the agent should already know the desired artifact is an unsigned transaction. The user should not need to specify ABI safety instructions, nesting details, or return format. The agent may use the listed contracts to build a realistic batched, routed, nested, or account-abstraction transaction when that is implied by the contract set, but every encoded call must use a function returned by this tool for the exact target address + chainId. If a selector is not returned for the exact address + chainId, do not use it. The final agent output should be the unsigned transaction fields: to, data, value, chainId.

Use this before encoding calldata when an agent or transaction builder only knows a function name like executeBatch(...), swap(...), approve(...), or transfer(...). It returns canonical ABI signatures and computed selectors for that specific contract only, so agents do not hallucinate selectors from training data or reuse a same-named ABI from another contract. For signing flows, still call clear_sign_payload on the final unsigned transaction before signing/broadcasting.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_function_selectors"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoAlias for contractAddress
addressNoAlias for contractAddress
chainIdNoChain ID
selectorNoOptional selector filter to verify against this exact contract metadata, e.g. 0x47e1da2a
functionNameNoOptional exact ABI function name filter, e.g. executeBatch
contractAddressNoExact target contract address (0x...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

No annotations provided, so description bears the burden. It does disclose useful behavior: metadata is local to KaiSign, exact address+chainId scoping, anti-hallucination semantics, returns canonical ABI signatures + computed selectors. But there's a large amount of builder-UX material mixed in, and it doesn't cover rate limits, permissions, or failure modes. It's actually substantial, but the retention-worthy facts are buried.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Several paragraphs of builder UX guidance about what the final artifact should be, nesting, ABI safety, etc., which is mostly agent-behavior instruction rather than tool description. Front-loaded purpose is good, but bloated and repetitive, restating the anti-hallucination point multiple times.

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?

Complete enough for a lookup tool: explains selectivity, exact-match requirement, and handoff to clear_sign_payload. Lacks output format explanation, though the text implies returns signatures and selectors. Six optional params with no required ones — the description doesn't explain what happens with zero params, which is a gap.

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

Parameters5/5

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

Schema coverage is 100%, so baseline 3 applies. However, the description adds meaning beyond the schema: explains that address/to are aliases, that contract address + chainId scoping is exact and required for correctness, and that selectors must match. Useful behavioral context around parameter usage.

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?

Specific verb + resource: 'resolve function selectors from KaiSign local metadata for an exact contract address + chainId'. Distinguishes itself clearly from siblings like verify_contract_metadata and clear_sign_payload.

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?

Explicitly states when to use: 'before encoding calldata when an agent only knows a function name like executeBatch(...)'. Also states when-not (if selector isn't returned for exact address+chainId, don't use it) and names the follow-on alternative clear_sign_payload for signing flows.

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