Skip to main content
Glama
max-paulus

gong-mcp

by max-paulus

postv2callstranscript

Download call transcripts from Gong using filters like date ranges, call IDs, or participant emails to access conversation records.

Instructions

Download transcripts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestBodyYesThe JSON request body.

Implementation Reference

  • src/index.ts:80-89 (registration)
    Registration of the 'postv2callstranscript' tool in the toolDefinitionMap, including its metadata, input schema, HTTP method, path, and security requirements.
    ["postv2callstranscript", {
      name: "postv2callstranscript",
      description: `Download transcripts`,
      inputSchema: {"type":"object","properties":{"requestBody":{"type":"object","required":["filter"],"properties":{"filter":{"type":"object","properties":{"fromDateTime":{"type":"string","format":"date-time"},"toDateTime":{"type":"string","format":"date-time"},"callIds":{"type":"array","items":{"type":"string"}},"primaryUserIds":{"type":"array","items":{"type":"string"}},"participantsEmails":{"type":"array","items":{"type":"string","format":"email"}}}},"cursor":{"type":"string"}},"description":"The JSON request body."}},"required":["requestBody"]},
      method: "post",
      pathTemplate: "/v2/calls/transcript",
      executionParameters: [],
      requestBodyContentType: "application/json",
      securityRequirements: [{"basicAuth":[]}]
    }],
  • Input schema definition for the tool, defining the expected requestBody with filter (date range, callIds, users, emails) and optional cursor for pagination.
    inputSchema: {"type":"object","properties":{"requestBody":{"type":"object","required":["filter"],"properties":{"filter":{"type":"object","properties":{"fromDateTime":{"type":"string","format":"date-time"},"toDateTime":{"type":"string","format":"date-time"},"callIds":{"type":"array","items":{"type":"string"}},"primaryUserIds":{"type":"array","items":{"type":"string"}},"participantsEmails":{"type":"array","items":{"type":"string","format":"email"}}}},"cursor":{"type":"string"}},"description":"The JSON request body."}},"required":["requestBody"]},
  • Generic tool execution handler that performs input validation, constructs the API request (POST to https://api.gong.io/v2/calls/transcript with JSON body and Basic Auth), executes the axios call, and returns the response as formatted JSON text. Handles errors including validation and API failures.
    async function executeApiTool(
        toolName: string,
        definition: McpToolDefinition,
        toolArgs: JsonObject,
        allSecuritySchemes: Record<string, any>
    ): Promise<CallToolResult> {
        try {
            // Validate input arguments using Zod
            const zodSchema = getZodSchemaFromJsonSchema(definition.inputSchema, toolName);
            const validatedArgs = zodSchema.parse(toolArgs);
    
            // Build the request URL
            let url = API_BASE_URL + definition.pathTemplate;
            
            // Replace path parameters
            for (const param of definition.executionParameters) {
                if (param.in === 'path') {
                    const value = validatedArgs[param.name];
                    if (value !== undefined) {
                        url = url.replace(`{${param.name}}`, encodeURIComponent(value));
                    }
                }
            }
    
            // Build query parameters
            const queryParams: Record<string, string> = {};
            for (const param of definition.executionParameters) {
                if (param.in === 'query') {
                    const value = validatedArgs[param.name];
                    if (value !== undefined) {
                        queryParams[param.name] = value;
                    }
                }
            }
            
            if (Object.keys(queryParams).length > 0) {
                url += '?' + new URLSearchParams(queryParams).toString();
            }
    
            // Debug logging (safe)
            console.error('Debug - Making API request to:', url);
            
            // Get credentials from environment
            const accessKey = process.env.GONG_ACCESS_KEY || '';
            const secret = process.env.GONG_SECRET || '';
            
            if (!accessKey || !secret) {
                throw new Error('Missing Gong credentials in environment');
            }
            
            // Create authorization header
            const authHeader = `Basic ${Buffer.from(`${accessKey}:${secret}`).toString('base64')}`;
            
            // Build request config
            const config: AxiosRequestConfig = {
                method: definition.method,
                url,
                headers: {
                    'Accept': 'application/json',
                    'Authorization': authHeader
                }
            };
    
            // Add request body if needed
            if (definition.requestBodyContentType) {
                config.headers!['Content-Type'] = definition.requestBodyContentType;
                if (validatedArgs.requestBody) {
                    config.data = validatedArgs.requestBody;
                }
            }
    
            // Make the request
            const response = await axios(config);
            
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify(response.data, null, 2)
                    }
                ]
            };
    
        } catch (error: any) {
            if (error instanceof ZodError) {
                return {
                    content: [{
                        type: 'text',
                        text: `Validation error: ${error.message}`
                    }]
                };
            }
            
            if (axios.isAxiosError(error)) {
                return {
                    content: [{
                        type: 'text',
                        text: formatApiError(error)
                    }]
                };
            }
    
            return {
                content: [{
                    type: 'text',
                    text: `Unexpected error: ${error.message}`
                }]
            };
        }
    }
  • MCP server request handler for CallToolRequestSchema that dispatches to the specific tool definition and executes it via executeApiTool.
    server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest): Promise<CallToolResult> => {
      const { name: toolName, arguments: toolArgs } = request.params;
      const toolDefinition = toolDefinitionMap.get(toolName);
      if (!toolDefinition) {
        console.error(`Error: Unknown tool requested: ${toolName}`);
        return { content: [{ type: "text", text: `Error: Unknown tool requested: ${toolName}` }] };
      }
      return await executeApiTool(toolName, toolDefinition, toolArgs ?? {}, securitySchemes);
    });
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. 'Download transcripts' implies a read-only retrieval operation, but it doesn't specify whether this requires authentication, involves pagination (hinted by the 'cursor' parameter), returns structured data or files, has rate limits, or what happens on errors. For a tool with complex filtering parameters and no annotation coverage, this is a significant gap in transparency.

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 extremely concise with just two words, 'Download transcripts', which is front-loaded and wastes no space. While this conciseness comes at the cost of clarity and completeness, it earns a high score for brevity and lack of redundancy.

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 tool's complexity (1 parameter with nested objects for filtering), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the tool's behavior, output format, or how to interpret results, leaving the agent with insufficient context to use it effectively. The high schema coverage helps with parameters, but overall guidance is inadequate.

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%, with the schema fully documenting the 'requestBody' parameter and its nested 'filter' and 'cursor' properties. The description adds no parameter-specific information beyond what the schema provides—it doesn't explain the meaning of 'filter' fields (e.g., date ranges, call IDs) or how 'cursor' works. Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

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

Purpose2/5

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

The description 'Download transcripts' is a tautology that essentially restates the tool name 'postv2callstranscript' without adding meaningful specificity. It doesn't clarify what 'transcripts' refer to (call transcripts), what 'download' entails (retrieval vs. file generation), or how this differs from sibling tools like 'getv2callsbyid' or 'postv2callsextensive'. The purpose remains vague and indistinguishable from alternatives.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, nor does it reference sibling tools like 'getv2callsbyid' (which might fetch call details) or 'postv2callsextensive' (which might handle broader call data). Without any usage instructions, the agent has no basis for selecting this tool appropriately.

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/max-paulus/gong-mcp'

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