uber_get_auth_url
Generate an Uber authorization URL for user authentication, enabling access to Uber ride booking and management through the MCP Uber Server. Requires a unique user ID for operation.
Instructions
Get the Uber authorization URL for user to authenticate
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | Unique identifier for the user |
Implementation Reference
- src/index.ts:166-177 (handler)Handler for uber_get_auth_url tool: parses userId, calls uberClient.getAuthorizationUrl, and returns the auth URL in text response.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}`, }, ], }; }
- src/uber-client.ts:23-32 (helper)Core implementation in UberClient: constructs Uber OAuth authorization URL using config and state (userId).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()}`; }
- src/index.ts:35-37 (schema)Zod schema for input validation: requires userId string.const AuthorizeSchema = z.object({ userId: z.string().describe('Unique identifier for the user'), });
- src/index.ts:108-111 (registration)Tool registration in TOOLS array: defines name, description, and input schema.{ name: 'uber_get_auth_url', description: 'Get the Uber authorization URL for user to authenticate', inputSchema: zodToJsonSchema(AuthorizeSchema),