Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

deposit

Destructive

Generate a Stripe checkout URL to deposit funds into your wallet for marketplace transactions. After payment, funds are credited automatically to enable service purchases.

Instructions

Generate a Stripe checkout URL to deposit funds into your wallet. Returns a URL that must be visited to complete the payment. After payment, funds are credited automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountCentsYesAmount to deposit in cents (minimum $1.00 = 100)

Implementation Reference

  • Main deposit tool registration and handler. Defines the tool with name 'deposit', description, input schema using zod validation (amountCents, minimum 100), and the handler logic that retrieves the agent ID, gets wallet info, validates wallet ID, and calls createDeposit to generate a Stripe checkout URL.
    // deposit — Get a Stripe checkout URL to add funds
    server.tool(
      'deposit',
      'Generate a Stripe checkout URL to deposit funds into your wallet. Returns a URL that must be visited to complete the payment. After payment, funds are credited automatically.',
      {
        amountCents: z.number().min(100).describe('Amount to deposit in cents (minimum $1.00 = 100)'),
      },
      { destructiveHint: true, idempotentHint: false, openWorldHint: true },
      async (params) => {
        const agentId = await client.getAgentId();
        const walletInfo = await client.getWallet(agentId);
        const walletId = walletInfo.id || walletInfo.walletId;
    
        if (!walletId) {
          return {
            content: [{ type: 'text' as const, text: 'Could not determine wallet ID. Check your profile.' }],
            isError: true,
          };
        }
    
        const result = await client.createDeposit(walletId, params.amountCents);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
        };
      }
    );
  • Input validation schema for the deposit tool. Defines amountCents parameter as a number with minimum value of 100 (representing $1.00).
    {
      amountCents: z.number().min(100).describe('Amount to deposit in cents (minimum $1.00 = 100)'),
    },
  • API client method that makes the actual HTTP POST request to create a deposit. Calls the /policy-wallets/{walletId}/deposit endpoint with the amountCents in the request body.
    async createDeposit(walletId: string, amountCents: number): Promise<any> {
      return this.request(`/policy-wallets/${walletId}/deposit`, {
        method: 'POST',
        body: { amountCents },
      });
    }
  • Base HTTP request method used by createDeposit. Constructs the full URL with base path, handles query parameters, sets authorization headers, and makes the fetch request with proper method, headers, and body serialization.
    private async request<T>(path: string, opts: RequestOptions = {}): Promise<T> {
      const { method = 'GET', body, params } = opts;
    
      let url = `${this.baseUrl}/v1${path}`;
    
      // Append query params
      if (params) {
        const searchParams = new URLSearchParams();
        for (const [key, value] of Object.entries(params)) {
          if (value !== undefined && value !== '') {
            searchParams.set(key, String(value));
          }
        }
        const qs = searchParams.toString();
        if (qs) url += `?${qs}`;
      }
    
      const headers: Record<string, string> = {
        'Authorization': `Bearer ${this.apiKey}`,
        'Content-Type': 'application/json',
        'X-Theagora-Source': 'mcp',
      };
    
      const res = await fetch(url, {
        method,
        headers,
        body: body ? JSON.stringify(body) : undefined,
      });
  • src/index.ts:25-25 (registration)
    Registration call that invokes registerIdentityTools to register all identity-related tools including the deposit tool.
    registerIdentityTools(server, client);
Behavior4/5

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

Annotations indicate destructiveHint=true (funds movement) and openWorldHint=true (external interaction), but the description adds valuable context: it specifies that a URL is returned and must be visited externally to complete payment, and notes automatic crediting afterward. This clarifies the multi-step, interactive nature beyond the 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?

The description is front-loaded with the core action, uses two efficient sentences with zero waste, and each part (URL generation, visitation requirement, automatic crediting) adds essential information without redundancy.

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's complexity (involving external payment flow), annotations cover key behavioral hints, but no output schema exists. The description compensates by explaining the return value (a URL) and post-payment outcome, though it could note error cases or idempotency (hinted as false in annotations).

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 description coverage is 100%, with the parameter 'amountCents' fully documented in the schema (amount in cents, minimum 100). The description does not add any parameter-specific details beyond what the schema provides, so it meets the baseline for high schema coverage.

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 specific action ('Generate a Stripe checkout URL') and resource ('deposit funds into your wallet'), distinguishing it from sibling tools like 'wallet' (which likely shows balance) or 'place_order' (which involves purchases). It explicitly mentions the payment flow and automatic crediting, providing a complete picture of the tool's function.

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 usage for depositing funds via Stripe, with no explicit alternatives or exclusions mentioned. It provides clear context (e.g., 'funds are credited automatically'), but lacks guidance on when not to use it (e.g., versus other payment methods or tools like 'check_escrow').

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

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