Skip to main content
Glama

hz_generate_summary

Generate Markdown summaries from Horizon content stages to condense information and extract key insights for analysis.

Instructions

从某阶段内容生成 Markdown 摘要。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes
languageNozh
source_stageNo
horizon_pathNo
config_pathNo
save_to_horizon_dataNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The business logic implementation of the summary generation tool.
    async def generate_summary(
        self,
        run_id: str,
        language: str = "zh",
        source_stage: str | None = None,
        horizon_path: str | None = None,
        config_path: str | None = None,
        save_to_horizon_data: bool = False,
    ) -> dict[str, Any]:
        stage = source_stage or self._pick_summary_stage(run_id)
        items, ctx = self._load_stage_items(
            run_id=run_id,
            stage=stage,
            horizon_path=horizon_path,
            config_path=config_path,
        )
    
        total_fetched = self._total_fetched(run_id, fallback=len(items))
        date_str = datetime.now(timezone.utc).strftime("%Y-%m-%d")
    
        summarizer = ctx.runtime.DailySummarizer()
        summary = await summarizer.generate_summary(
            items,
            date_str,
            total_fetched,
            language=language,
        )
    
        run_summary_path = self.run_store.save_summary(run_id, language, summary)
        published_path = None
        if save_to_horizon_data:
            storage = make_storage(ctx.runtime, ctx.config_path)
            published_path = storage.save_daily_summary(date_str, summary, language=language)
    
        summary_meta = {
            "summary_stage": stage,
            "summary_language": language,
            "summary_generated_at": datetime.now(timezone.utc).isoformat(),
            "summary_artifact": str(run_summary_path.resolve()),
        }
        if published_path:
            summary_meta["summary_published_path"] = str(Path(published_path).resolve())
        meta = self.run_store.update_meta(run_id, summary_meta)
    
        return {
            "run_id": run_id,
            "language": language,
            "source_stage": stage,
            "total_fetched": total_fetched,
            "items_used": len(items),
            "summary_path": str(run_summary_path.resolve()),
            "published_path": str(Path(published_path).resolve()) if published_path else None,
            "preview": summary[:1200],
            "meta": meta,
        }
  • The MCP tool registration and handler entrypoint.
    async def hz_generate_summary(
        run_id: str,
        language: str = "zh",
        source_stage: str | None = None,
        horizon_path: str | None = None,
        config_path: str | None = None,
        save_to_horizon_data: bool = False,
    ) -> dict[str, Any]:
        """从某阶段内容生成 Markdown 摘要。"""
    
        return await _run_tool(
            "hz_generate_summary",
            lambda: service.generate_summary(
                run_id=run_id,
                language=language,
                source_stage=source_stage,
                horizon_path=horizon_path,
                config_path=config_path,
                save_to_horizon_data=save_to_horizon_data,
            ),
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions generating a Markdown summary but doesn't explain what happens during generation, whether this is a read-only operation or creates new data, what permissions might be required, or how the output relates to the input parameters. The description is too minimal to adequately inform an agent about the tool's behavior beyond the basic action.

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 extremely concise - a single sentence in Chinese. While this could be seen as efficient, it borders on under-specification rather than true conciseness. There's no wasted language, but also no helpful elaboration. The structure is simple and front-loaded with the core action.

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

Completeness3/5

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

Given that there's an output schema (which should document return values), the description doesn't need to explain outputs. However, for a tool with 6 parameters (all undocumented in schema), no annotations, and complex sibling relationships, the single-sentence description is inadequate. It doesn't provide enough context about what 'stage content' means, how the generation works, or when to use this versus other summary-related tools.

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?

With 0% schema description coverage and 6 parameters (1 required, 5 optional), the description provides no information about any parameters. It doesn't explain what 'run_id', 'language', 'source_stage', 'horizon_path', 'config_path', or 'save_to_horizon_data' mean or how they affect the summary generation. The description fails to compensate for the complete lack of parameter documentation in the schema.

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

Purpose3/5

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

The description states the basic purpose ('从某阶段内容生成 Markdown 摘要' - 'Generate Markdown summary from certain stage content'), which identifies the verb (generate) and resource (summary). However, it's vague about what '某阶段内容' (certain stage content) refers to and doesn't distinguish this tool from sibling tools like hz_get_run_summary or hz_get_run_stage that might also retrieve or process stage-related information.

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. There are multiple sibling tools that deal with runs, stages, and summaries (hz_get_run_summary, hz_get_run_stage, hz_get_run_meta), but the description doesn't explain how this generation tool differs from those retrieval tools or when one should be preferred over another.

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/henry-insomniac/Horizon-mcp'

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