Skip to main content
Glama

app_response

Generate and store responses for app requests using string, list, or table data formats. Ensures proper data structure for seamless app integration.

Instructions

Use this to return a response to the app that has been requested. Provide only one of string_data, list_data, or table_data. Args: string_data: Optional string response list_data: Optional list of strings response table_data: Optional table response with columns and rows Format: {"columns": ["col1", "col2", ...], "rows": [["row1col1", "row1col2", ...], ...]} Returns: True if the response was stored successfully, False otherwise

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_dataNo
string_dataNo
table_dataNo

Implementation Reference

  • main.py:615-665 (handler)
    The handler function for the 'app_response' MCP tool. It validates that exactly one type of data (string, list, or table) is provided, stores it in the global 'app_response' variable, sets 'response_ready' to True, and notifies waiting threads (used by the HTTP server to respond to frontend requests). The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool() def app_response(string_data: str = None, list_data: List[str] = None, table_data: Dict[str, List] = None) -> bool: """ Use this to return a response to the app that has been requested. Provide only one of string_data, list_data, or table_data. Args: string_data: Optional string response list_data: Optional list of strings response table_data: Optional table response with columns and rows Format: {"columns": ["col1", "col2", ...], "rows": [["row1col1", "row1col2", ...], ...]} Returns: True if the response was stored successfully, False otherwise """ global app_response, response_lock, response_ready try: # Check that exactly one data type is provided provided_data = [d for d in [string_data, list_data, table_data] if d is not None] if len(provided_data) != 1: logger.error("Exactly one of string_data, list_data, or table_data must be provided") return False # Determine the type of data and store it if string_data is not None: data = string_data elif list_data is not None: data = list_data elif table_data is not None: # Validate table_data format if not isinstance(table_data, dict) or "columns" not in table_data or "rows" not in table_data: logger.error("Table data must have 'columns' and 'rows' keys") return False data = table_data # Store the response and notify waiting threads with response_lock: global app_response # Declare global inside the function block app_response = data global response_ready # Declare global inside the function block response_ready = True response_lock.notify_all() return True except Exception as e: logger.error(f"Error storing response: {e}") return False
  • main.py:615-615 (registration)
    The @mcp.tool() decorator registers the app_response function as an MCP tool.
    @mcp.tool()
  • The function signature and docstring define the input schema (one of string_data, list_data, or table_data) and output (bool success). FastMCP likely uses this to generate JSON schema for the tool.
    def app_response(string_data: str = None, list_data: List[str] = None, table_data: Dict[str, List] = None) -> bool: """ Use this to return a response to the app that has been requested. Provide only one of string_data, list_data, or table_data. Args: string_data: Optional string response list_data: Optional list of strings response table_data: Optional table response with columns and rows Format: {"columns": ["col1", "col2", ...], "rows": [["row1col1", "row1col2", ...], ...]} Returns: True if the response was stored successfully, False otherwise
  • main.py:38-40 (helper)
    Global variables used by the app_response tool and the HTTP handler to communicate responses to the frontend.
    app_response = None response_lock = threading.Condition() response_ready = False

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/michaelneale/goose-app-maker-mcp'

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