Skip to main content
Glama

write.asset_manager.merkl_operator

Read-onlyIdempotent

Encode args for Merkl operator automation to claim external incentive rewards from active Merkl campaigns into your account. Combine with rebalancer for extra yield on supported chains.

Instructions

Encode args for the Merkl operator automation. Claims external Merkl protocol incentive rewards into the account — additional rewards paid by token teams on top of regular LP fees. Enable when the pool has active Merkl campaigns (check APY breakdown in read.strategy.list). Always combine with rebalancer when both are relevant — no conflict, extra free yield. Available on all supported chains. Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reward_recipientYesAddress to receive Merkl rewards
enabledNoTrue to enable, false to disable
chain_idNoChain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
asset_managersYes
statusesYes
datasYes
strategy_nameNo

Implementation Reference

  • Handler function registerMerklOperatorTool that registers the write.asset_manager.merkl_operator MCP tool. Validates chain_id and reward_recipient, encodes Merkl operator callback data using ABI encoding, and returns {asset_managers, statuses, datas} for set_asset_managers. Supports enable/disable via enabled param.
    export function registerMerklOperatorTool(
      server: McpServer,
      _chains: Record<ChainId, ChainConfig>,
    ) {
      server.registerTool(
        "write.asset_manager.merkl_operator",
        {
          annotations: {
            title: "Encode Merkl Operator Automation",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
          },
          description:
            "Encode args for the Merkl operator automation. Claims external Merkl protocol incentive rewards into the account — additional rewards paid by token teams on top of regular LP fees. Enable when the pool has active Merkl campaigns (check APY breakdown in read.strategy.list). Always combine with rebalancer when both are relevant — no conflict, extra free yield. Available on all supported chains. Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.",
          outputSchema: IntentOutput,
          inputSchema: {
            reward_recipient: z.string().describe("Address to receive Merkl rewards"),
            enabled: z.boolean().default(true).describe("True to enable, false to disable"),
            chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
          },
        },
        async (params) => {
          try {
            const validChainId = validateChainId(params.chain_id);
            const amAddress = getStandaloneAmAddress(validChainId, "merklOperator");
    
            if (!params.enabled)
              return formatResult(disabledIntent([amAddress], "Disable merkl_operator"));
    
            const validRewardRecipient = validateAddress(params.reward_recipient, "reward_recipient");
            const callbackData = encodeMerklOperatorCallbackData(MERKL_INITIATOR, validRewardRecipient);
    
            const result = {
              description: "Enable merkl_operator",
              asset_managers: [amAddress],
              statuses: [true],
              datas: [callbackData],
            };
            return formatResult(result);
          } catch (err) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Error: ${err instanceof Error ? err.message : String(err)}`,
                },
              ],
              isError: true,
            };
          }
        },
      );
  • Input/output schema for the tool: requires reward_recipient (address string), enabled (boolean, default true), chain_id (number, default 8453). Output follows IntentOutput schema with asset_managers, statuses, datas arrays.
    {
      annotations: {
        title: "Encode Merkl Operator Automation",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
      description:
        "Encode args for the Merkl operator automation. Claims external Merkl protocol incentive rewards into the account — additional rewards paid by token teams on top of regular LP fees. Enable when the pool has active Merkl campaigns (check APY breakdown in read.strategy.list). Always combine with rebalancer when both are relevant — no conflict, extra free yield. Available on all supported chains. Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.",
      outputSchema: IntentOutput,
      inputSchema: {
        reward_recipient: z.string().describe("Address to receive Merkl rewards"),
        enabled: z.boolean().default(true).describe("True to enable, false to disable"),
        chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
      },
  • Tool registration entry point: registerMerklOperatorTool is called with (server, chains) in registerAllTools.
    import { registerSetAssetManagersTool } from "./write/asset-managers/set-asset-managers.js";
    import { registerSendTool } from "./dev/send.js";
    import { registerAddLiquidityTool } from "./write/account/add-liquidity.js";
    import { registerRemoveLiquidityTool } from "./write/account/remove-liquidity.js";
    import { registerSwapTool } from "./write/account/swap.js";
    import { registerDeleverageTool } from "./write/account/deleverage.js";
    import { registerStakeTool } from "./write/account/stake.js";
    import { registerCloseTool } from "./write/account/close.js";
    
    export function registerAllTools(
      server: McpServer,
      api: ArcadiaApiClient,
      chains: Record<ChainId, ChainConfig>,
    ) {
      // Read tools
      registerAccountTools(server, api, chains);
      registerPoolTools(server, api);
      registerAssetTools(server, api);
      registerStrategyTools(server, api);
      registerPointsTools(server, api);
      registerGuideTools(server);
      registerWalletTools(server, chains, api);
      registerAssetManagerTools(server);
    
      // Write tools — account
      registerCreateTool(server, chains);
      registerDepositTool(server, chains);
      registerWithdrawTool(server, chains);
      registerBorrowTool(server, chains, api);
      registerRepayTool(server, chains);
      registerAddLiquidityTool(server, api, chains);
      registerRemoveLiquidityTool(server, api);
      registerSwapTool(server, api);
      registerDeleverageTool(server, api);
      registerStakeTool(server, api);
      registerCloseTool(server, api, chains);
    
      // Write tools — wallet
      registerApproveTool(server, chains);
    
      // Write tools — pool (lending tranches, ERC-4626)
      registerPoolDepositTool(server, chains);
      registerPoolRedeemTool(server, chains);
    
      // Write tools — asset managers
      registerRebalancerTool(server, chains);
      registerCompounderTools(server, chains);
      registerYieldClaimerTools(server, chains);
      registerCowSwapperTool(server, chains);
      registerMerklOperatorTool(server, chains);
  • encodeMerklOperatorCallbackData: ABI-encodes initiator address, rewardRecipient address, maxClaimFee, and empty metadata for the Merkl operator callback. Uses MERKL_INITIATOR address (0x521541D932B15631e8a1B037f17457C801722bA0).
    export function encodeMerklOperatorCallbackData(
      initiator: `0x${string}`,
      rewardRecipient: `0x${string}`,
    ): `0x${string}` {
      return encodeAbiParameters(
        [
          { name: "initiator", type: "address" },
          { name: "rewardRecipient", type: "address" },
          { name: "maxClaimFee", type: "uint256" },
          { name: "metaData_", type: "bytes" },
        ],
        [initiator, rewardRecipient, DEFAULT_MAX_CLAIM_FEE, "0x"],
      );
    }
  • getStandaloneAmAddress: resolves the standalone AM address for merklOperator (0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6) from the address book.
    export function getStandaloneAmAddress(chainId: ChainId, am: StandaloneAm): string {
      if (!CHAIN_STANDALONE_AMS[chainId].has(am)) {
        const supportedChains = (
          Object.entries(CHAIN_STANDALONE_AMS) as [string, ReadonlySet<StandaloneAm>][]
        )
          .filter(([, ams]) => ams.has(am))
          .map(([id]) => `${CHAIN_NAMES[Number(id) as ChainId]} (${id})`)
          .join(", ");
        throw new Error(
          `${STANDALONE_TO_USER_FACING[am]} is not available on ${CHAIN_NAMES[chainId]} (${chainId}). Supported chains: ${supportedChains}.`,
        );
      }
      return STANDALONE_AM_ADDRESSES[am];
    }
Behavior2/5

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

The description states 'Claims external Merkl protocol incentive rewards,' which implies a mutation, but annotations declare readOnlyHint=true, contradicting the mutation claim. This reduces transparency significantly. Beyond the contradiction, the description adds some context about combinability and chain support.

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

Conciseness4/5

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

The description is 5 sentences with key info front-loaded: action, purpose, usage cues, return value, and combinability. It is concise and structured, though slightly wordy in the middle.

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 tool has annotations, a simple input schema, and mentions an output structure, the description covers necessary context: how to check campaign status, combine with other tools, chain availability, and how to use the output. It lacks prerequisities like wallet permissions but is adequate for a non-mutating encoding tool.

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?

Schema coverage is 100% with descriptions for all three parameters. The description re-iterates the reward_recipient and chain_id values but adds no major insight beyond the schema. Baseline score of 3 is appropriate since schema does the heavy lifting.

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 encodes args for Merkl operator automation to claim external Merkl rewards. It specifies when to use it (active Merkl campaigns) and distinguishes itself from sibling tools like rebalancer by noting they should be combined, and from other asset managers by focusing on Merkl incentives.

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 clear usage context: enable when active Merkl campaigns exist, combine with rebalancer when relevant, and combines with other intent tools. However, it lacks explicit 'when not to use' guidance or direct comparison to other asset manager tools like yield_claimer.

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/arcadia-finance/mcp-server'

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