Skip to main content
Glama
listingbureau

Listing Bureau - Amazon Organic Ranking

lb_account_update_profile

Idempotent

Update your Listing Bureau account profile by changing first name, last name, or company name. Provide at least one field to modify.

Instructions

Update Listing Bureau account profile fields (first_name, last_name, company). At least one field required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
first_nameNoNew first name
last_nameNoNew last name
companyNoNew company name

Implementation Reference

  • The actual handler function for lb_account_update_profile. It accepts optional first_name, last_name, and company params, builds a request body with only the provided fields, validates at least one field is provided, then sends a PATCH request to /api/v1/account/profile and returns the result.
    async (params) => {
      try {
        const body: Record<string, unknown> = {};
        if (params.first_name !== undefined) body.first_name = params.first_name;
        if (params.last_name !== undefined) body.last_name = params.last_name;
        if (params.company !== undefined) body.company = params.company;
    
        if (Object.keys(body).length === 0) {
          return formatErrorResult(
            new Error("At least one field (first_name, last_name, company) must be provided"),
          );
        }
    
        const res = await client.request<Account>(
          "PATCH",
          "/api/v1/account/profile",
          body,
          undefined,
          "lb_account_update_profile",
        );
        return formatResult(res.data);
      } catch (e) {
        return formatErrorResult(e);
      }
    },
  • The Zod schema defining input parameters for lb_account_update_profile: first_name (optional string), last_name (optional string), and company (optional string).
    {
      first_name: z.string().optional().describe("New first name"),
      last_name: z.string().optional().describe("New last name"),
      company: z.string().optional().describe("New company name"),
    },
    { idempotentHint: true  },
  • The tool is registered on the MCP server via server.tool() inside registerAccountTools(), with the name 'lb_account_update_profile', a description, the zod schema, idempotentHint, and the async handler.
    server.tool(
      "lb_account_update_profile",
      "Update Listing Bureau account profile fields (first_name, last_name, company). At least one field required.",
      {
        first_name: z.string().optional().describe("New first name"),
        last_name: z.string().optional().describe("New last name"),
        company: z.string().optional().describe("New company name"),
      },
      { idempotentHint: true  },
      async (params) => {
        try {
          const body: Record<string, unknown> = {};
          if (params.first_name !== undefined) body.first_name = params.first_name;
          if (params.last_name !== undefined) body.last_name = params.last_name;
          if (params.company !== undefined) body.company = params.company;
    
          if (Object.keys(body).length === 0) {
            return formatErrorResult(
              new Error("At least one field (first_name, last_name, company) must be provided"),
            );
          }
    
          const res = await client.request<Account>(
            "PATCH",
            "/api/v1/account/profile",
            body,
            undefined,
            "lb_account_update_profile",
          );
          return formatResult(res.data);
        } catch (e) {
          return formatErrorResult(e);
        }
      },
    );
  • src/index.ts:56-56 (registration)
    registerAccountTools is called in the main server setup (index.ts line 56), which registers the tool on the McpServer.
    registerAccountTools(server, client);
  • formatResult helper used by the handler to format the API response data into a CallToolResult.
    export function formatResult(data: unknown): CallToolResult {
      const warnings: string[] = [];
      let cleaned: Record<string, unknown> | unknown = data;
    
      if (data && typeof data === "object") {
        const obj = { ...(data as Record<string, unknown>) };
    
        // Top-level warning string
        if ("warning" in obj && typeof obj.warning === "string") {
          warnings.push(obj.warning);
          delete obj.warning;
        }
    
        // balance_warning object (independent of warning)
        if ("balance_warning" in obj && obj.balance_warning && typeof obj.balance_warning === "object") {
          const bw = obj.balance_warning as Record<string, unknown>;
          const parts: string[] = [];
          if (typeof bw.warning === "string" && bw.warning.trim()) parts.push(bw.warning);
          if (typeof bw.daily_cost_estimate === "number")
            parts.push(`Daily cost estimate: $${bw.daily_cost_estimate.toFixed(2)}`);
          if (typeof bw.balance === "number")
            parts.push(`Balance: $${bw.balance.toFixed(2)}`);
          if (typeof bw.days_remaining === "number")
            parts.push(`Days remaining: ${bw.days_remaining.toFixed(1)}`);
          if (parts.length > 0) warnings.push(parts.join(" | "));
          delete obj.balance_warning;
        }
    
        cleaned = obj;
      }
    
      let text = JSON.stringify(cleaned, null, 2);
      for (const w of warnings) {
        text += `\n\n⚠️ Warning: ${w}`;
      }
    
      const notice = getUpdateNotice();
      if (notice) {
        text += `\n\n${notice}`;
      }
    
      return {
        content: [{ type: "text", text }],
      };
    }
Behavior4/5

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

Annotations include idempotentHint: true, and the description describes the update operation. It adds the behavioral constraint that at least one field is required. No contradiction with annotations. More details on side effects or auth requirements would improve, but current is adequate.

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?

Two sentences, 15 words, front-loaded with verb and resource. No redundant information. Efficiently conveys purpose and key constraint.

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 simple update tool with 3 optional fields and no output schema, the description covers what it does and the required constraint. It lacks return value information (e.g., returns updated profile or empty), but overall it is sufficiently complete given the low complexity.

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 has 100% description coverage (each param described as 'New first/last/company name'). The description lists the fields and adds the constraint that at least one field is required, which is not present in the schema's required array. This adds value beyond the schema.

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?

Description clearly states the action (update), resource (Listing Bureau account profile), and specific fields (first_name, last_name, company). It also distinguishes from sibling tools like lb_account_get (read-only). The constraint 'at least one field required' adds specificity.

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 implies when to use: when you need to update those three profile fields. It states the requirement that at least one field must be provided. However, it does not explicitly mention alternatives or when not to use, though the context is clear given sibling tools.

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/listingbureau/listingbureau-mcp'

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