get_survey_summary
Extract survey summaries from Notion pages to review collected data and analyze responses for research purposes.
Instructions
Get survey summary
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_id": "<page_id>"
},
"name": "get_survey_summary"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes |
Implementation Reference
- server.py:72-83 (handler)The handler function for the 'get_survey_summary' tool, registered via @mcp.tool(). It fetches the Notion page details, including properties and the plain text from the first code block, and returns them as a JSON string.
@mcp.tool() def get_survey_summary(page_id: str): """Get survey summary""" page = notion.pages.retrieve(page_id) parent = notion.blocks.retrieve(page_id) children = notion.blocks.children.list(page_id) body = "" for child in children["results"]: if child["type"] == "code": body = child["code"]["rich_text"][0]["plain_text"] break return json.dumps({"parent": parent, "properties": page["properties"], "body": body}, ensure_ascii=False)