Skip to main content
Glama
peakmojo

Zoom Recordings No-Auth

by peakmojo

zoom_refresh_token

Renew Zoom OAuth2 access tokens using refresh tokens and client credentials to maintain uninterrupted API access for Zoom Recordings No-Auth server.

Instructions

Refresh the Zoom OAuth2 access token using the refresh token and client credentials for API access

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zoom_access_tokenNoZoom OAuth2 access token (optional if expired)
zoom_client_idYesZoom OAuth2 client ID for token refresh
zoom_client_secretYesZoom OAuth2 client secret for token refresh
zoom_refresh_tokenYesZoom OAuth2 refresh token

Implementation Reference

  • Handler function for the 'zoom_refresh_token' tool. Instantiates ZoomClient with provided tokens and calls refreshAccessToken method.
    async ({ zoom_access_token, zoom_refresh_token, zoom_client_id, zoom_client_secret }) => {
      try {
        const zoom = new ZoomClient({
          accessToken: zoom_access_token,
          refreshToken: zoom_refresh_token
        });
        
        const result = await zoom.refreshAccessToken(zoom_client_id, zoom_client_secret);
        return {
          content: [{ type: 'text', text: result }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: JSON.stringify({ error: error.message, status: 'error' }) }]
        };
      }
    }
  • Zod schema defining input parameters for the zoom_refresh_token tool.
      zoom_access_token: z.string().optional().describe('Zoom OAuth2 access token (optional if expired)'),
      zoom_refresh_token: z.string().describe('Zoom OAuth2 refresh token'),
      zoom_client_id: z.string().describe('Zoom OAuth2 client ID for token refresh'),
      zoom_client_secret: z.string().describe('Zoom OAuth2 client secret for token refresh')
    },
  • server.js:305-305 (registration)
    Registration of the zoom_refresh_token tool using server.tool().
    'zoom_refresh_token',
  • ZoomClient method that performs the actual token refresh by making POST to Zoom OAuth endpoint.
    async refreshAccessToken(clientId, clientSecret) {
      logger.debug(`Starting refreshAccessToken with clientId=${clientId?.slice(0, 5)}...`);
      
      if (!this.refreshToken) {
        return JSON.stringify({
          error: "No refresh token provided",
          status: "error"
        });
      }
        
      try {
        this.clientId = clientId;
        this.clientSecret = clientSecret;
        
        const authHeader = Buffer.from(`${clientId}:${clientSecret}`).toString('base64');
        
        const headers = {
          "Authorization": `Basic ${authHeader}`,
          "Content-Type": "application/x-www-form-urlencoded"
        };
        
        const data = {
          grant_type: "refresh_token",
          refresh_token: this.refreshToken
        };
        
        logger.debug(`Making POST request to Zoom OAuth token endpoint with refreshToken=${this.refreshToken.slice(0, 10)}...`);
        
        const response = await axios.post(
          "https://zoom.us/oauth/token",
          data,
          { headers }
        );
        
        logger.debug(`Received response with status code: ${response.status}`);
        
        if (response.status === 200) {
          const result = response.data;
          logger.debug("Successfully refreshed token");
          this.accessToken = result.access_token;
          this.refreshToken = result.refresh_token || this.refreshToken;
          
          const expiresIn = result.expires_in || 3600;
          const expiry = DateTime.now().plus({ seconds: expiresIn });
          
          return JSON.stringify({
            access_token: this.accessToken,
            refresh_token: this.refreshToken,
            expires_at: expiry.toISO(),
            expires_in: expiresIn,
            status: "success"
          });
        } else {
          logger.error(`Failed to refresh token: ${response.status}, Response: ${response.data}`);
          return JSON.stringify({
            error: `Failed to refresh token. Status code: ${response.status}`,
            details: response.data,
            raw_response: response.data,
            status: "error"
          });
        }
      } catch (error) {
        logger.error(`Exception in refreshAccessToken: ${error.message}`);
        return JSON.stringify({
          error: error.message,
          status: "error"
        });
      }
    }
  • Handler logic within handle_call_tool for executing zoom_refresh_token tool.
    if name == "zoom_refresh_token":
        # For refresh token, we need refresh token, client ID and secret
        refresh_token = arguments.get("zoom_refresh_token")
        client_id = arguments.get("zoom_client_id")
        client_secret = arguments.get("zoom_client_secret")
        access_token = arguments.get("zoom_access_token")  # Optional for refresh
        
        logger.debug(f"Refresh token parameters: refresh_token={refresh_token[:10] if refresh_token else None}..., client_id={client_id[:5] if client_id else None}...")
        
        if not refresh_token:
            raise ValueError("zoom_refresh_token is required for token refresh")
        
        if not client_id or not client_secret:
            raise ValueError("Both zoom_client_id and zoom_client_secret are required for token refresh")
        
        # Initialize Zoom client for token refresh
        logger.debug("Initializing ZoomClient for token refresh")
        zoom = ZoomClient(
            access_token=access_token, 
            refresh_token=refresh_token
        )
        
        # Call the refresh_access_token method with proper error handling
        try:
            logger.debug("Calling zoom.refresh_access_token")
            results = zoom.refresh_access_token(client_id=client_id, client_secret=client_secret)
            logger.debug(f"Results from refresh_access_token: {results[:100]}...")
            return [types.TextContent(type="text", text=results)]
        except Exception as e:
            logger.error(f"Exception in refresh_access_token: {str(e)}", exc_info=True)
            # Print the actual error to help debug
            return [types.TextContent(type="text", text=json.dumps({
                "error": str(e),
                "status": "error"
            }))]
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. It states the tool's action but lacks behavioral details such as whether this is a read-only or mutating operation (though 'Refresh' implies mutation), authentication requirements beyond parameters, rate limits, error conditions, or what the output looks like (no output schema). This is a significant gap for a security-sensitive tool.

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 a single, efficient sentence that front-loads the core purpose ('Refresh the Zoom OAuth2 access token') and includes essential context without waste. Every word earns its place, making it highly concise and well-structured.

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

Completeness2/5

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

Given the complexity of an OAuth2 token refresh operation, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., mutability, security implications), error handling, and output format, which are critical for an AI agent to use this tool correctly and safely.

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?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds minimal value beyond the schema by mentioning the optional 'zoom_access_token' parameter context ('optional if expired'), but does not provide additional syntax, format, or usage details. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Refresh') and resource ('Zoom OAuth2 access token'), with explicit mention of the method ('using the refresh token and client credentials') and purpose ('for API access'). It distinguishes this authentication tool from its sibling tools (e.g., zoom_get_meeting_transcript) which are data retrieval operations.

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

Usage Guidelines3/5

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

The description implies usage context (when the access token needs refreshing for API access) but does not explicitly state when to use this tool versus alternatives (e.g., initial token acquisition) or any prerequisites beyond the parameters. It mentions the optional 'zoom_access_token' parameter indirectly via 'optional if expired', but lacks clear when-not-to-use guidance.

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

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/peakmojo/mcp-server-zoom-noauth'

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