Skip to main content
Glama

freshbooks_authenticate_with_code

Complete FreshBooks authentication by entering an authorization code manually when callback servers are unavailable. Paste the code from the redirect URL to establish secure API access.

Instructions

Complete authentication with an authorization code (if callback server isn't used). Paste the code from the redirect URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Implementation Reference

  • The implementation of the 'freshbooks_authenticate_with_code' tool, which handles the exchange of an authorization code for access tokens and verifies the authentication status.
    @mcp.tool()
    def freshbooks_authenticate_with_code(code: str) -> str:
        """Complete authentication with an authorization code (if callback server isn't used). Paste the code from the redirect URL."""
        config = auth.get_config()
        tokens = auth.exchange_code(config, code)
        if tokens:
            identity = auth.get_identity(tokens["access_token"])
            return f"Authenticated as {identity['first_name']} {identity['last_name']} ({identity['email']})\nBusiness: {identity['business_name']}\nAccount ID: {identity['account_id']}"
        return "Authentication failed."

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/AlexlaGuardia/MCP-Freshbooks'

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