Skip to main content
Glama

auth_get_url

Generate OAuth authorization URL to authenticate and connect with FreshBooks for accounting, invoicing, time tracking, and expense management.

Instructions

Get OAuth authorization URL to authenticate with FreshBooks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for executing the auth_get_url tool. Generates the OAuth authorization URL and returns it along with instructions for the user.
    * Handle auth_get_url tool */ private async handleAuthGetUrl() { const url = this.oauth.generateAuthorizationUrl(); return { content: [ { type: 'text', text: JSON.stringify( { authorizationUrl: url, instructions: [ '1. Visit the authorization URL in your browser', '2. Log in to FreshBooks and authorize the application', '3. Copy the authorization code from the redirect URL', '4. Call auth_exchange_code with the authorization code', ], }, null, 2 ), }, ], }; }
  • src/server.ts:91-97 (registration)
    Registration of the auth_get_url tool in the MCP listTools handler, defining its name, description, and empty input schema.
    name: 'auth_get_url', description: 'Get OAuth authorization URL to authenticate with FreshBooks', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema for the auth_get_url tool (no parameters required).
    inputSchema: { type: 'object', properties: {}, },
  • Core helper function that constructs the OAuth authorization URL using FreshBooks endpoints, client credentials, and optional state.
    generateAuthorizationUrl(state?: string): string { const params = new URLSearchParams({ client_id: this.config.clientId, response_type: 'code', redirect_uri: this.config.redirectUri, }); // Add scopes if configured if (this.config.scopes?.length) { params.set('scope', this.config.scopes.join(' ')); } // Add state parameter for CSRF protection if (state) { params.set('state', state); } return `${FreshBooksOAuth.AUTH_URL}?${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/Good-Samaritan-Software-LLC/freshbooks-mcp'

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