Skip to main content
Glama

proxy_authenticated_request

Makes authenticated HTTP requests by injecting stored credentials from Auth Box, keeping them hidden from the agent. Provides secure access to services without credential exposure.

Instructions

Make an authenticated HTTP request through Auth Box. The stored credential is injected into the request without exposing it to the agent. This is the preferred method for using credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesName of the service whose credential to use for authentication
methodYesHTTP method
urlYesFull URL to send the request to
headersNoAdditional HTTP headers (auth headers are injected automatically)
bodyNoRequest body (for POST/PUT/PATCH)

Implementation Reference

  • The main handler for the 'proxy_authenticated_request' tool. Method 'toolProxyRequest' evaluates policies (including step-up approval), constructs a ProxyRequest, and calls 'bridge.proxyRequest' to execute the authenticated HTTP request.
    private async toolProxyRequest(
      session: MCPSession,
      policies: AgentPolicy[],
      args: Record<string, unknown>,
    ): Promise<ToolCallResult> {
      const serviceName = args.service_name as string;
    
      const request: AccessRequest = {
        agentId: session.agentId,
        action: 'proxy',
      };
    
      const decision = this.policyEngine.evaluate(policies, request);
    
      // Handle step-up approval for proxy requests
      if (!decision.allowed && decision.pendingApprovalId) {
        const approved = await this.policyEngine.requestApproval(
          decision.pendingApprovalId,
          request,
        );
        if (!approved) {
          decision.reason = 'Step-up approval denied by user';
          await this.logAccess(session, 'proxy_request', serviceName, decision);
          return {
            content: [{ type: 'text', text: 'Access denied: step-up approval was denied by the user' }],
            isError: true,
          };
        }
        decision.allowed = true;
        decision.reason = 'Step-up approval granted by user';
      }
    
      await this.logAccess(session, 'proxy_request', serviceName, decision);
    
      if (!decision.allowed) {
        return {
          content: [{ type: 'text', text: `Access denied: ${decision.reason}` }],
          isError: true,
        };
      }
    
      const proxyReq: ProxyRequest = {
        method: args.method as string,
        url: args.url as string,
        headers: args.headers as Record<string, string> | undefined,
        body: args.body as string | undefined,
      };
    
      try {
        const response = await this.bridge.proxyRequest(session.userId, serviceName, proxyReq);
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              status: response.status,
              headers: response.headers,
              body: response.body,
            }),
          }],
        };
      } catch (err) {
        return {
          content: [{ type: 'text', text: `Proxy request failed: ${err instanceof Error ? err.message : 'Unknown error'}` }],
          isError: true,
        };
      }
    }
  • Tool definition (name, description, inputSchema) for 'proxy_authenticated_request'. Defines required input params: service_name, method, url; optional: headers, body.
    {
      name: 'proxy_authenticated_request',
      description:
        'Make an authenticated HTTP request through Auth Box. The stored credential is injected into the request without exposing it to the agent. This is the preferred method for using credentials.',
      inputSchema: {
        type: 'object',
        properties: {
          service_name: {
            type: 'string',
            description: 'Name of the service whose credential to use for authentication',
          },
          method: {
            type: 'string',
            enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
            description: 'HTTP method',
          },
          url: {
            type: 'string',
            description: 'Full URL to send the request to',
          },
          headers: {
            type: 'object',
            additionalProperties: { type: 'string' },
            description: 'Additional HTTP headers (auth headers are injected automatically)',
          },
          body: {
            type: 'string',
            description: 'Request body (for POST/PUT/PATCH)',
          },
        },
        required: ['service_name', 'method', 'url'],
      },
    },
  • Tool dispatch registration in 'handleToolCall' switch statement: routes the tool name 'proxy_authenticated_request' to 'toolProxyRequest'.
    switch (toolName) {
      case 'get_credential':
        return this.toolGetCredential(session, policies, args);
      case 'proxy_authenticated_request':
        return this.toolProxyRequest(session, policies, args);
      case 'list_available_services':
        return this.toolListServices(session, policies);
      default:
        return {
          content: [{ type: 'text', text: `Unknown tool: ${toolName}` }],
          isError: true,
        };
    }
  • Supporting types: ProxyRequest and ProxyResponse interfaces used by the proxy handler.
    export interface ProxyRequest {
      method: string;
      url: string;
      headers?: Record<string, string>;
      body?: string;
    }
    
    export interface ProxyResponse {
      status: number;
      headers: Record<string, string>;
      body: string;
    }
    
    export interface ToolCallResult {
      content: Array<{ type: 'text'; text: string }>;
      isError?: boolean;
    }
  • Stdio server registration of 'proxy_authenticated_request' tool with Zod schema for MCP client discovery (fallback handler returning error if no vault bridge).
    server.tool(
      'proxy_authenticated_request',
      'Make an authenticated HTTP request through Auth Box. The stored credential is injected into the request without exposing it to the agent. This is the preferred method for using credentials.',
      {
        service_name: z.string().describe('Name of the service whose credential to use for authentication'),
        method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).describe('HTTP method'),
        url: z.string().describe('Full URL to send the request to'),
        headers: z.record(z.string()).optional().describe('Additional HTTP headers (auth headers are injected automatically)'),
        body: z.string().optional().describe('Request body (for POST/PUT/PATCH)'),
      },
      async () => ({
        content: [{ type: 'text' as const, text: JSON.stringify({ error: 'Vault bridge not configured. Connect to a running Auth Box instance.' }) }],
      }),
    );
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the security behavior (credential injection without exposure) but does not mention rate limits, error behavior, or whether the request is read-only or can modify state (depending on method). Sufficient but minimal.

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, no wasted words. Front-loaded with the primary action, then adds the critical security benefit. Highly concise and well-structured.

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 has 5 parameters (3 required) and no output schema, the description adequately covers the core functionality and security context. It could mention expected response format or error handling, but the key aspects are present.

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%, so baseline is 3. The description adds no additional parameter meaning beyond what is in the schema; it only reaffirms that credentials are injected automatically, which is already in the headers parameter description.

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 action (make authenticated HTTP request), the resource (through Auth Box), and the key benefit (credential injection without exposure). It distinguishes from sibling tools: get_credential retrieves credentials, while this tool uses them for requests.

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 says 'This is the preferred method for using credentials,' implying the agent should use this tool over alternatives like get_credential when making authenticated requests. However, it does not explicitly contrast with siblings or state when not to use it.

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/MARUCIE/authbox'

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