Skip to main content
Glama

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
NameRequiredDescriptionDefault
accessTokenYesUber access token for the user
userIdYesUnique identifier for the user

Implementation Reference

  • 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', }, ], }; }
  • 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), },
  • 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}`; }

Other Tools

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

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