Skip to main content
Glama

write.asset_manager.yield_claimer

Read-onlyIdempotent

Encode arguments to automate claiming pending fees and emissions from liquidity positions and send them to a designated recipient.

Instructions

Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dex_protocolYesDEX protocol of the LP position — used to resolve the correct asset manager address.
fee_recipientYesAddress to receive claimed fees (wallet address or any destination)
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

  • Registration function that registers the 'write.asset_manager.yield_claimer' tool. The handler (lines 43-75) validates chain_id and dex_protocol, resolves the yield claimer AM address, validates the fee_recipient, encodes callback data via encodeYieldClaimerCallbackData, and returns {asset_managers, statuses, datas}.
    export function registerYieldClaimerTools(
      server: McpServer,
      _chains: Record<ChainId, ChainConfig>,
    ) {
      server.registerTool(
        "write.asset_manager.yield_claimer",
        {
          annotations: {
            title: "Encode Yield Claimer Automation",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
          },
          description:
            "Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.",
          outputSchema: IntentOutput,
          inputSchema: {
            dex_protocol: DEX_PROTOCOL_SCHEMA,
            fee_recipient: z
              .string()
              .describe("Address to receive claimed fees (wallet address or any destination)"),
            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 amKey = dexProtocolToAmKey(params.dex_protocol);
            const amAddress = getAmProtocolAddress(validChainId, "yieldClaimers", amKey);
    
            if (!params.enabled)
              return formatResult(
                disabledIntent([amAddress], `Disable yield_claimer (${params.dex_protocol})`),
              );
    
            const validFeeRecipient = validateAddress(params.fee_recipient, "fee_recipient");
            const callbackData = encodeYieldClaimerCallbackData(CLAIMER_INITIATOR, validFeeRecipient);
    
            const result = {
              description: `Enable yield_claimer (${params.dex_protocol})`,
              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 schema and annotations for the yield_claimer tool. Inputs: dex_protocol (enum), fee_recipient (address), enabled (boolean, default true), chain_id (number, default 8453). Output schema is IntentOutput.
    {
      annotations: {
        title: "Encode Yield Claimer Automation",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
      description:
        "Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.",
      outputSchema: IntentOutput,
      inputSchema: {
        dex_protocol: DEX_PROTOCOL_SCHEMA,
        fee_recipient: z
          .string()
          .describe("Address to receive claimed fees (wallet address or any destination)"),
        enabled: z.boolean().default(true).describe("True to enable, false to disable"),
        chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
      },
  • encodeYieldClaimerCallbackData — encodes ABI-encoded callback data for the yield claimer with initiator address, fee recipient, max claim fee, and empty metadata.
    export function encodeYieldClaimerCallbackData(
      initiator: `0x${string}`,
      feeRecipient: `0x${string}`,
    ): `0x${string}` {
      return encodeAbiParameters(
        [
          { name: "initiator", type: "address" },
          { name: "feeRecipient", type: "address" },
          { name: "maxClaimFee", type: "uint256" },
          { name: "metaData_", type: "bytes" },
        ],
        [initiator, feeRecipient, DEFAULT_MAX_CLAIM_FEE, "0x"],
      );
    }
  • Top-level registration call: registerYieldClaimerTools(server, chains) in the registerAllTools function.
      registerYieldClaimerTools(server, chains);
      registerCowSwapperTool(server, chains);
      registerMerklOperatorTool(server, chains);
      registerSetAssetManagersTool(server, chains);
    
      // Dev tools
      registerSendTool(server, chains);
    }
  • Read-only listing of the yield_claimer tool definition with description, required params, and chain availability.
    {
      id: "yield_claimer",
      tool: "write.asset_manager.yield_claimer",
      description: "Claims pending fees/emissions and sends to a designated recipient address.",
      sets_managers: ["yield_claimer"],
      required_params: [
        DEX_PROTOCOL_PARAM,
        { name: "fee_recipient", type: "address", hint: "address to receive claimed fees" },
      ],
      optional_params: [],
      chains: ALL_CHAINS,
    },
Behavior4/5

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

Annotations include readOnlyHint=true, consistent with the tool encoding args rather than mutating state. The description clarifies the encoding role and that actual execution occurs via write.account.set_asset_managers. No contradictions; adds value beyond 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?

Three sentences with no waste. Front-loaded with the core action and purpose, followed by output details and combinability. Every sentence adds value.

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 annotations and schema, the description covers the tool's role, output, and usage pattern. Sibling tools are numerous but distinct. The standalone yield claimer concept could be elaborated, but overall complete for intended use.

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 4 parameters. The description adds contextual info about output and combinability but doesn't significantly enhance parameter meanings beyond schema. Baseline of 3 is appropriate.

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 verb 'Encode args' and the resource 'yield claimer automation' for claiming pending fees/emissions. It distinguishes from sibling asset_manager tools by specifying the purpose (yield claiming) and output usage.

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?

Provides guidance on how to use the output by stating 'Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers' and mentions combinability with other intent tools. No explicit when-not, but sufficient context.

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