Skip to main content
Glama

azeth_update_service_batch

Update multiple service metadata fields in one transaction to save gas costs when modifying endpoint, description, capabilities, name, entityType, or pricing.

Instructions

Update multiple metadata fields for your registered service in a single transaction.

Use this when: You need to change several metadata fields at once (e.g., endpoint + description + capabilities). This is more gas-efficient than calling azeth_update_service multiple times.

Supported metadata keys: "endpoint", "description", "capabilities", "name", "entityType", "pricing". For capabilities, provide a JSON array string (e.g., '["translation", "nlp"]').

Note: Catalogs are off-chain. Update your catalog by updating your endpoint response.

Returns: Confirmation with a single transaction hash for all updates.

Note: All updates are atomic — if one fails, none are applied. Maximum 5 key-value pairs per batch.

Example: { "updates": [{"key": "endpoint", "value": "https://api.example.com/v2"}, {"key": "description", "value": "Updated service"}] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoTarget chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").
updatesYesArray of {key, value} pairs to update. Max 5 updates per batch.

Implementation Reference

  • The handler function for 'azeth_update_service_batch' which uses client.updateServiceMetadataBatch to execute the updates.
    async (args) => {
      let client;
      try {
        client = await createClient(args.chain);
    
        const txHash = await client.updateServiceMetadataBatch(
          args.updates as Array<{ key: string; value: string }>,
        );
    
        return success({
          updates: (args.updates as Array<{ key: string; value: string }>).map(u => ({
            key: u.key,
            value: u.value,
          })),
          count: (args.updates as Array<{ key: string; value: string }>).length,
          message: `${(args.updates as Array<{ key: string; value: string }>).length} metadata field(s) updated in a single transaction.`,
        }, { txHash });
      } catch (err) {
        return handleError(err);
      } finally {
        try { await client?.destroy(); } catch { /* M-10 */ }
      }
  • Input schema definition for the 'azeth_update_service_batch' tool, enforcing a maximum of 5 updates and specific allowed keys.
    inputSchema: z.object({
      chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'),
      updates: z.preprocess(
        (val) => typeof val === 'string' ? JSON.parse(val) : val,
        z.array(z.object({
          key: z.enum(['endpoint', 'description', 'capabilities', 'name', 'entityType', 'pricing']),
          value: z.string().min(1).max(2048),
        })).min(1).max(5),
      ).describe('Array of {key, value} pairs to update. Max 5 updates per batch.'),
    }),
  • Registration of the 'azeth_update_service_batch' tool in the MCP server.
    server.registerTool(
      'azeth_update_service_batch',
      {
        description: [
          'Update multiple metadata fields for your registered service in a single transaction.',
          '',
          'Use this when: You need to change several metadata fields at once (e.g., endpoint + description + capabilities).',
          'This is more gas-efficient than calling azeth_update_service multiple times.',
          '',
          'Supported metadata keys: "endpoint", "description", "capabilities", "name", "entityType", "pricing".',
          'For capabilities, provide a JSON array string (e.g., \'["translation", "nlp"]\').',
          '',
          'Note: Catalogs are off-chain. Update your catalog by updating your endpoint response.',
          '',
          'Returns: Confirmation with a single transaction hash for all updates.',
          '',
          'Note: All updates are atomic — if one fails, none are applied.',
          'Maximum 5 key-value pairs per batch.',
          '',
          'Example: { "updates": [{"key": "endpoint", "value": "https://api.example.com/v2"}, {"key": "description", "value": "Updated service"}] }',
        ].join('\n'),
        inputSchema: z.object({
          chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'),
          updates: z.preprocess(
            (val) => typeof val === 'string' ? JSON.parse(val) : val,
            z.array(z.object({
              key: z.enum(['endpoint', 'description', 'capabilities', 'name', 'entityType', 'pricing']),
              value: z.string().min(1).max(2048),
            })).min(1).max(5),
          ).describe('Array of {key, value} pairs to update. Max 5 updates per batch.'),
        }),
      },
Behavior4/5

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

With no annotations provided, the description carries full behavioral disclosure burden. It successfully communicates atomicity ('if one fails, none are applied'), gas efficiency benefits, the off-chain nature of catalogs, and return value structure ('Confirmation with a single transaction hash'). Could mention error handling or revert conditions for a 5.

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?

Well-structured with clear logical blocks (purpose, usage condition, supported keys, behavioral notes, example). Every section earns its place. Slightly verbose but efficiently organized with front-loaded purpose. The example JSON adds value despite length.

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 blockchain mutation tool with no annotations and no output schema, the description adequately covers return behavior, transaction limits (max 5), atomicity guarantees, and architectural constraints (off-chain catalogs). Missing only minor details like specific error codes or confirmation timing.

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%, establishing baseline 3. The description adds crucial semantic detail not in schema: the JSON array string format requirement for 'capabilities' (e.g., '["translation", "nlp"]'), and provides a concrete JSON example showing the nested updates structure, which clarifies how to populate the complex array parameter.

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 opens with a specific verb ('Update') and clear resource ('metadata fields for your registered service'), and explicitly distinguishes from sibling tool azeth_update_service by stating it's for 'multiple fields' and is 'more gas-efficient than calling azeth_update_service multiple times.' This precisely scopes the tool's purpose.

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?

Contains explicit 'Use this when' clause specifying the batch use case (changing several fields at once) and directly names the alternative tool (azeth_update_service) for single updates. Provides clear guidance on when to prefer this over the singular variant.

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/azeth-protocol/mcp-azeth'

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