Skip to main content
Glama

hz_enrich_items

Enhance high-scoring content with background enrichment to prepare it for the enriched stage in the Horizon content pipeline.

Instructions

对高分内容执行背景富化,写入 enriched 阶段。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes
source_stageNofiltered
horizon_pathNo
config_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual logic for enrichment, implemented as a service method called by the MCP tool handler.
    async def enrich_items(
        self,
        run_id: str,
        source_stage: str = "filtered",
        horizon_path: str | None = None,
        config_path: str | None = None,
    ) -> dict[str, Any]:
        items, ctx = self._load_stage_items(
            run_id=run_id,
            stage=source_stage,
            horizon_path=horizon_path,
            config_path=config_path,
        )
    
        if not items:
            raise HorizonMcpError(code="HZ_EMPTY_INPUT", message="待富化内容为空。")
    
        ai_client = ctx.runtime.create_ai_client(ctx.config.ai)
        enricher = ctx.runtime.ContentEnricher(ai_client)
        await enricher.enrich_batch(items)
    
        self.run_store.save_items(run_id, "enriched", items_to_dicts(items))
    
        citation_count = 0
        for item in items:
            citation_count += len(item.metadata.get("sources", []))
    
        meta = self.run_store.update_meta(
            run_id,
            {
                "enriched_count": len(items),
                "citation_count": citation_count,
            },
        )
    
        return {
            "run_id": run_id,
            "enriched": len(items),
            "citation_count": citation_count,
            "artifact": str((self.run_store.run_dir(run_id) / "enriched_items.json").resolve()),
            "meta": meta,
        }
  • MCP tool definition and registration for 'hz_enrich_items', which wraps the service method call.
    async def hz_enrich_items(
        run_id: str,
        source_stage: str = "filtered",
        horizon_path: str | None = None,
        config_path: str | None = None,
    ) -> dict[str, Any]:
        """对高分内容执行背景富化,写入 enriched 阶段。"""
    
        return await _run_tool(
            "hz_enrich_items",
            lambda: service.enrich_items(
                run_id=run_id,
                source_stage=source_stage,
                horizon_path=horizon_path,
                config_path=config_path,
            ),
        )
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 indicates a write operation ('写入 enriched 阶段'), suggesting mutation, but it doesn't disclose critical traits like permissions needed, whether it's idempotent, rate limits, or what happens if enrichment fails. The description is too brief to provide adequate behavioral context for a tool that modifies data.

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 concise with a single sentence, front-loaded with the core action. There's no wasted text, but it may be overly brief, risking under-specification. It efficiently states the purpose without 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 (involving enrichment and writing to a stage), lack of annotations, 0% schema description coverage, and 4 parameters, the description is incomplete. It doesn't explain the enrichment process, error handling, or output (though an output schema exists, which mitigates some gaps). For a mutation tool in a pipeline context, more detail is needed to guide the agent effectively.

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 for 4 parameters, the description must compensate by explaining parameter meanings, but it adds no information beyond the schema. It doesn't clarify what 'run_id', 'source_stage', 'horizon_path', or 'config_path' are used for, leaving the agent to guess based on titles alone. This is insufficient given the low coverage.

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 tool '对高分内容执行背景富化,写入 enriched 阶段' (performs background enrichment on high-scoring content, writes to the enriched stage), which provides a specific verb ('执行背景富化') and resource ('高分内容'), but it doesn't clearly distinguish this from sibling tools like hz_filter_items or hz_score_items, which might also process content in a pipeline. The purpose is somewhat vague regarding what 'background enrichment' entails.

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 mentions writing to the 'enriched stage', which implies it's part of a pipeline, but it doesn't specify prerequisites (e.g., after scoring or filtering) or name any sibling tools as alternatives. Without explicit when-to-use or when-not-to-use instructions, the agent lacks clear context.

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