Skip to main content
Glama

uber_get_auth_url

Generate an Uber authorization URL for user authentication to enable AI assistants to book and manage rides through the MCP Uber Server.

Instructions

Get the Uber authorization URL for user to authenticate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUnique identifier for the user

Implementation Reference

  • Handler for uber_get_auth_url tool: parses userId from arguments, generates authorization URL using UberClient, and returns a text response with the URL.
    case 'uber_get_auth_url': { const { userId } = AuthorizeSchema.parse(args); const authUrl = await uberClient.getAuthorizationUrl(userId); return { content: [ { type: 'text', text: `Please visit this URL to authorize Uber access: ${authUrl}`, }, ], }; }
  • Zod schema for input validation of uber_get_auth_url tool, defining the required userId parameter.
    const AuthorizeSchema = z.object({ userId: z.string().describe('Unique identifier for the user'), });
  • src/index.ts:108-112 (registration)
    Registration of the uber_get_auth_url tool in the TOOLS array, including name, description, and input schema.
    { name: 'uber_get_auth_url', description: 'Get the Uber authorization URL for user to authenticate', inputSchema: zodToJsonSchema(AuthorizeSchema), },
  • UberClient method that constructs the Uber OAuth authorization URL using configuration parameters.
    async getAuthorizationUrl(state: string): Promise<string> { const params = new URLSearchParams({ client_id: this.config.clientId, response_type: 'code', redirect_uri: this.config.redirectUri, scope: 'profile request ride_request', state, }); return `${this.config.authBaseUrl}/oauth/v2/authorize?${params.toString()}`; }

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/199-mcp/mcp-uber'

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