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); }

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