uber_set_access_token
Store Uber access tokens for users after OAuth authentication, enabling AI assistants to manage rides via the MCP Uber Server.
Instructions
Set the access token for a user after OAuth callback
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessToken | Yes | Uber access token for the user | |
| userId | Yes | Unique identifier for the user |
Implementation Reference
- src/index.ts:179-191 (handler)The main handler for uber_set_access_token tool. Parses input using SetTokenSchema, stores the access token in userTokens map keyed by userId, sets it on the uberClient instance, and returns a success message.case 'uber_set_access_token': { const { userId, accessToken } = SetTokenSchema.parse(args); userTokens.set(userId, accessToken); uberClient.setAccessToken(accessToken); return { content: [ { type: 'text', text: 'Access token set successfully', }, ], }; }
- src/index.ts:39-42 (schema)Zod schema definition for the input parameters of uber_set_access_token: userId (string) and accessToken (string).const SetTokenSchema = z.object({ userId: z.string().describe('Unique identifier for the user'), accessToken: z.string().describe('Uber access token for the user'), });
- src/index.ts:113-117 (registration)Tool registration in the TOOLS array provided to the MCP server, specifying name, description, and input schema.{ name: 'uber_set_access_token', description: 'Set the access token for a user after OAuth callback', inputSchema: zodToJsonSchema(SetTokenSchema), },
- src/uber-client.ts:19-21 (helper)UberClient helper method called by the handler to set the Bearer token Authorization header on the axios instance for subsequent API calls.setAccessToken(token: string) { this.api.defaults.headers.common['Authorization'] = `Bearer ${token}`; }