Skip to main content
Glama

get_credential

Retrieve credentials from the Auth Box vault for services like GitHub or AWS. Returns only fields permitted by access policies, protecting secrets unless explicitly allowed.

Instructions

Retrieve a credential from the Auth Box vault. Returns credential fields filtered by the agent's access policy. Never returns the raw secret unless the policy explicitly allows "read" action.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesName of the service to retrieve credentials for (e.g., "GitHub", "AWS")
fieldsNoSpecific fields to retrieve. Omit to get all permitted fields.

Implementation Reference

  • The toolGetCredential method handles the logic for executing the 'get_credential' tool, including policy enforcement, user approval, and calling the bridge to fetch the credential.
    private async toolGetCredential(
      session: MCPSession,
      policies: AgentPolicy[],
      args: Record<string, unknown>,
    ): Promise<ToolCallResult> {
      const serviceName = args.service_name as string;
      const fields = args.fields as string[] | undefined;
    
      const request: AccessRequest = {
        agentId: session.agentId,
        action: 'read',
      };
    
      const decision = this.policyEngine.evaluate(policies, request);
    
      // Handle step-up approval: wait for user decision
      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, 'get_credential', serviceName, decision);
          return {
            content: [{ type: 'text', text: 'Access denied: step-up approval was denied by the user' }],
            isError: true,
          };
        }
        // User approved -- continue with credential retrieval
        decision.allowed = true;
        decision.reason = 'Step-up approval granted by user';
      }
    
      await this.logAccess(session, 'get_credential', serviceName, decision);
    
      if (!decision.allowed) {
        return {
          content: [{ type: 'text', text: `Access denied: ${decision.reason}` }],
          isError: true,
        };
      }
    
      const credential = await this.bridge.getCredential(session.userId, serviceName);
      if (!credential) {
        return {
          content: [{ type: 'text', text: `No credential found for service: ${serviceName}` }],
          isError: true,
        };
      }
    
      // Filter fields if requested
      const filtered = fields
        ? Object.fromEntries(Object.entries(credential).filter(([k]) => fields.includes(k)))
  • Defines the schema and description for the 'get_credential' tool.
    {
      name: 'get_credential',
      description:
        'Retrieve a credential from the Auth Box vault. Returns credential fields filtered by the agent\'s access policy. Never returns the raw secret unless the policy explicitly allows "read" action.',
      inputSchema: {
        type: 'object',
        properties: {
          service_name: {
            type: 'string',
            description: 'Name of the service to retrieve credentials for (e.g., "GitHub", "AWS")',
          },
          fields: {
            type: 'array',
            items: { type: 'string' },
            description: 'Specific fields to retrieve. Omit to get all permitted fields.',
          },
        },
        required: ['service_name'],
      },
    },
    {
Behavior4/5

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

Excellent disclosure given zero annotations. Explicitly states security-critical behavior: fields are filtered by access policy, and raw secrets are masked unless explicit 'read' permission exists. This adds essential context about data sensitivity and access control that the schema cannot convey.

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?

Three tightly constructed sentences with zero redundancy. Purpose stated immediately, followed by return behavior and security constraints. Every sentence delivers essential information for a credential-handling tool.

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?

Strong coverage for a tool with no output schema and no annotations. Describes return values (filtered fields), security constraints (access policies), and secret-handling behavior. Covers the critical security domain adequately, though could mention error cases (e.g., missing service).

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. Description adds contextual framing ('Auth Box vault') and security semantics around the fields parameter (access policy filtering), but does not elaborate on parameter syntax or formats beyond what the schema already documents.

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?

Clear verb ('Retrieve') and resource ('credential from the Auth Box vault'). Implicitly distinguishes from siblings (list_available_services lists services; proxy_authenticated_request uses credentials) through distinct action words, though lacks explicit comparative guidance.

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

Usage Guidelines3/5

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

Implies usage constraints through access policy requirements ('filtered by the agent's access policy', 'Never returns the raw secret unless...'), guiding the agent toward permission checks. However, lacks explicit 'when to use vs. siblings' guidance (e.g., when to prefer proxy_authenticated_request over retrieving credentials).

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