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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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."
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'Complete[s] authentication,' implying a state-changing operation, but doesn't disclose critical traits like whether it requires prior setup, what happens on success/failure, if it stores tokens, or any rate limits. The description adds minimal context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with two concise sentences that directly address the tool's purpose and parameter usage. Every sentence earns its place by providing essential information without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (authentication with state changes), no annotations, and an output schema (which reduces the need to explain return values), the description is partially complete. It covers the basic action and parameter context but lacks details on prerequisites, error handling, or security implications, which are important for an authentication tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds meaning by explaining that the 'code' comes from 'the redirect URL' and should be 'Paste[d],' clarifying its source and usage. However, it doesn't detail the code's format, length, or validation rules, leaving some semantic gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Complete authentication with an authorization code.' It specifies the verb ('Complete authentication') and resource ('authorization code'), and distinguishes it from the sibling 'freshbooks_authenticate' by mentioning 'if callback server isn't used.' However, it doesn't fully differentiate from all siblings, as other tools like 'freshbooks_whoami' also relate to authentication.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: 'if callback server isn't used.' It implies an alternative (using a callback server) but doesn't explicitly name it or detail when not to use this tool. No misleading guidance is present, but it lacks explicit exclusions or comparisons to other authentication-related siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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