Skip to main content
Glama

authenticate

Complete OAuth2 authentication with authorization code to enable interaction with Google Slides presentations for creating slides, adding shapes, and managing content.

Instructions

Complete OAuth2 authentication with authorization code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAuthorization code from OAuth2 flow

Implementation Reference

  • The handler function for the 'authenticate' tool. It calls the auth service to exchange the authorization code for tokens and returns a success message.
    private async handleAuthenticate(args: { code: string }): Promise<CallToolResult> {
      await this.auth.getTokens(args.code);
      return {
        content: [
          {
            type: 'text',
            text: 'Authentication successful! You can now use Google Slides tools.',
          },
        ],
      };
    }
  • The schema definition for the 'authenticate' tool, including input schema for the authorization code, registered in the listTools handler.
    {
      name: 'authenticate',
      description: 'Complete OAuth2 authentication with authorization code',
      inputSchema: {
        type: 'object',
        properties: {
          code: {
            type: 'string',
            description: 'Authorization code from OAuth2 flow',
          },
        },
        required: ['code'],
      },
    },
  • src/index.ts:173-174 (registration)
    Registration of the 'authenticate' tool handler in the switch statement of the callTool request handler.
    case 'authenticate':
      return await this.handleAuthenticate(args as { code: string });
  • Helper function in the auth service that performs the actual token exchange using the authorization code and saves the tokens to file.
    async getTokens(code: string): Promise<void> {
      const { tokens } = await this.oauth2Client.getToken(code);
      this.oauth2Client.setCredentials(tokens);
      
      // Save tokens for future use
      await this.saveTokens(tokens);
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It correctly identifies this as an authentication operation (implying it establishes credentials/session), but doesn't specify whether it returns tokens, sets cookies, persists state, or has side effects like rate limits. It adds basic context about the OAuth2 mechanism but lacks operational details.

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 communicates the essential purpose without unnecessary words. It's front-loaded with the core action and includes only relevant technical context. Every element earns its place.

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 an authentication tool with no annotations and no output schema, the description adequately covers the basic purpose and usage context. However, it doesn't explain what happens after authentication completes (e.g., token storage, session establishment, or error handling), which would be important for agent decision-making. The description is complete enough for basic understanding but lacks operational details.

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 single parameter 'code' already documented in the schema as 'Authorization code from OAuth2 flow'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

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 ('Complete OAuth2 authentication') and the mechanism ('with authorization code'), distinguishing it from sibling tools like 'get_auth_url' which would provide the authorization code. It uses precise technical terminology that accurately reflects 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 Guidelines5/5

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

The description explicitly indicates when to use this tool: after obtaining an authorization code from an OAuth2 flow. It distinguishes from 'get_auth_url' (which would be used before this tool) and other presentation-related siblings, providing clear contextual boundaries for its application.

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/vamsikiran353-gif/google-slides-mcp'

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