Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

get_form_response

Retrieve specific response data from a Google Form by providing the user's email, form ID, and response ID, including detailed answers and metadata.

Instructions

Get one response from the form.

Args:
    user_google_email (str): The user's Google email address. Required.
    form_id (str): The ID of the form.
    response_id (str): The ID of the response to retrieve.

Returns:
    str: Response details including answers and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
form_idYes
response_idYes
serviceYes
user_google_emailYes

Implementation Reference

  • The complete implementation of the get_form_response tool handler, including decorators for registration (@server.tool()), error handling, and service requirement. This function fetches a specific response from a Google Form using the Forms API.
    @server.tool()
    @handle_http_errors("get_form_response", is_read_only=True, service_type="forms")
    @require_google_service("forms", "forms")
    async def get_form_response(
        service,
        user_google_email: str,
        form_id: str,
        response_id: str
    ) -> str:
        """
        Get one response from the form.
    
        Args:
            user_google_email (str): The user's Google email address. Required.
            form_id (str): The ID of the form.
            response_id (str): The ID of the response to retrieve.
    
        Returns:
            str: Response details including answers and metadata.
        """
        logger.info(f"[get_form_response] Invoked. Email: '{user_google_email}', Form ID: {form_id}, Response ID: {response_id}")
    
        response = await asyncio.to_thread(
            service.forms().responses().get(formId=form_id, responseId=response_id).execute
        )
    
        response_id = response.get("responseId", "Unknown")
        create_time = response.get("createTime", "Unknown")
        last_submitted_time = response.get("lastSubmittedTime", "Unknown")
    
        answers = response.get("answers", {})
        answer_details = []
        for question_id, answer_data in answers.items():
            question_response = answer_data.get("textAnswers", {}).get("answers", [])
            if question_response:
                answer_text = ", ".join([ans.get("value", "") for ans in question_response])
                answer_details.append(f"  Question ID {question_id}: {answer_text}")
            else:
                answer_details.append(f"  Question ID {question_id}: No answer provided")
    
        answers_text = "\n".join(answer_details) if answer_details else "  No answers found"
    
        result = f"""Form Response Details for {user_google_email}:
    - Form ID: {form_id}
    - Response ID: {response_id}
    - Created: {create_time}
    - Last Submitted: {last_submitted_time}
    - Answers:
    {answers_text}"""
    
        logger.info(f"Successfully retrieved response for {user_google_email}. Response ID: {response_id}")
        return result
  • The @server.tool() decorator registers the get_form_response function as an MCP tool.
    @server.tool()
  • Input schema defined by function parameters and type hints, along with docstring describing args and return type.
    async def get_form_response(
        service,
        user_google_email: str,
        form_id: str,
        response_id: str
    ) -> str:
        """
        Get one response from the form.
    
        Args:
            user_google_email (str): The user's Google email address. Required.
            form_id (str): The ID of the form.
            response_id (str): The ID of the response to retrieve.
    
        Returns:
            str: Response details including answers and metadata.
        """
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 states the tool retrieves a single response, implying a read-only operation, but doesn't address permissions, authentication needs, rate limits, error handling, or whether the response includes all metadata as claimed. For a tool with four required parameters and no annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is appropriately concise and well-structured, with a clear purpose statement followed by Args and Returns sections. Each sentence serves a purpose, though the parameter explanations could be more informative. It's front-loaded with the main functionality, avoiding unnecessary verbosity.

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 (4 required parameters, no annotations, no output schema), the description is incomplete. It doesn't fully explain parameter semantics, lacks behavioral context like authentication or error handling, and the return value description ('Response details including answers and metadata') is vague without an output schema. For a tool with this level of complexity, more detail is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It lists three parameters (user_google_email, form_id, response_id) with brief explanations, but omits the fourth parameter 'service' entirely. The explanations are minimal (e.g., 'The ID of the form') and don't provide format examples or constraints, leaving significant gaps in understanding.

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: 'Get one response from the form.' It specifies the verb ('Get') and resource ('response from the form'), making it distinct from siblings like 'list_form_responses' which retrieves multiple responses. However, it doesn't explicitly differentiate from 'get_form' (which retrieves form metadata), leaving some ambiguity.

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

Usage Guidelines2/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 sibling tools like 'list_form_responses' for multiple responses or 'get_form' for form metadata, nor does it specify prerequisites or contexts for usage. The agent must infer usage from the name and description alone.

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/taylorwilsdon/google_workspace_mcp'

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