Skip to main content
Glama

Add Organization Member

dual_add_org_member
Idempotent

Add a wallet to an organization with a specific role to manage access and permissions within the DUAL Web3 ecosystem.

Instructions

Add a wallet as a member to an organization with a specific role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_idYesResource ID
wallet_idYesWallet ID to add
role_idYesRole ID to assign

Implementation Reference

  • Handler function for dual_add_org_member tool. Takes organization_id, wallet_id, and role_id as parameters, makes a POST request to add the wallet as a member with the specified role, and returns a success message.
    }, async (params) => {
      try {
        const { organization_id, ...body } = params;
        await makeApiRequest(`organizations/${organization_id}/members`, "POST", body);
        return textResult(`Member ${params.wallet_id} added to organization.`);
      } catch (e) { return errorResult(handleApiError(e)); }
    });
  • IdParam schema definition used for validating the organization_id parameter - a non-empty string.
    export const IdParam = z.string().min(1).describe("Resource ID");
  • Registration of dual_add_org_member tool with server. Defines title, description, inputSchema with organization_id, wallet_id, and role_id parameters, and annotations indicating it's a non-readonly, idempotent operation.
    server.registerTool("dual_add_org_member", {
      title: "Add Organization Member",
      description: "Add a wallet as a member to an organization with a specific role.",
      inputSchema: {
        organization_id: IdParam,
        wallet_id: z.string().describe("Wallet ID to add"),
        role_id: z.string().describe("Role ID to assign"),
      },
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
    }, async (params) => {
      try {
        const { organization_id, ...body } = params;
        await makeApiRequest(`organizations/${organization_id}/members`, "POST", body);
        return textResult(`Member ${params.wallet_id} added to organization.`);
      } catch (e) { return errorResult(handleApiError(e)); }
    });
  • makeApiRequest helper function that makes HTTP requests to the DUAL API. Used by the handler to POST member data to the organizations/{id}/members endpoint.
    export async function makeApiRequest<T>(
      endpoint: string,
      method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" = "GET",
      data?: unknown,
      params?: Record<string, unknown>,
      options?: { timeout?: number; multipart?: boolean }
    ): Promise<T> {
      const config: AxiosRequestConfig = {
        method,
        url: `${API_BASE_URL}/${endpoint}`,
        headers: getAuthHeaders(),
        timeout: options?.timeout ?? 30000,
      };
    
      if (data !== undefined) config.data = data;
      if (params) config.params = params;
      if (options?.multipart) {
        config.headers = { ...config.headers, "Content-Type": "multipart/form-data" };
      }
    
      const response = await axios(config);
      return response.data as T;
    }
  • textResult and errorResult helper functions that format MCP tool responses. textResult creates a success response, errorResult creates an error response with isError flag.
    export function textResult(text: string) {
      return { content: [{ type: "text" as const, text }] };
    }
    
    /** Standard error content response */
    export function errorResult(text: string) {
      return { content: [{ type: "text" as const, text }], isError: true as const };
    }
Behavior3/5

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

Annotations provide substantial information: readOnlyHint=false indicates mutation, openWorldHint=true suggests flexible resource handling, idempotentHint=true implies safe retries, and destructiveHint=false indicates non-destructive. The description adds minimal behavioral context beyond this - it doesn't mention authentication requirements, rate limits, error conditions, or what happens on duplicate additions (though idempotency hints at safe retry). No contradiction with annotations exists.

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?

The description is a single, efficient sentence that states the core functionality without unnecessary words. It's front-loaded with the primary action and includes all essential elements (what, where, with what role). There's zero wasted verbiage or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with good annotation coverage but no output schema, the description is minimally adequate. It covers the basic operation but lacks important context about permissions needed, error responses, success criteria, or what the tool returns. The annotations help but don't fully compensate for the missing behavioral details in the description itself.

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?

With 100% schema description coverage, all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain format requirements, valid role IDs, or relationships between parameters. The baseline of 3 is appropriate when the schema carries the documentation burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a wallet as a member'), target resource ('to an organization'), and specifies the role assignment ('with a specific role'). It distinguishes from sibling 'dual_remove_org_member' by being the complementary add operation, though it doesn't explicitly contrast with other organization-related tools like 'dual_create_organization' or 'dual_update_organization'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., organization must exist, wallet must be valid), doesn't specify when to use batch operations instead, and doesn't reference related tools like 'dual_create_org_role' for role creation or 'dual_list_org_members' for verification.

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/ro-ro-b/dual-mcp-server'

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