Skip to main content
Glama

hz_score_items

Score content items using AI to evaluate and categorize data in the Horizon pipeline, enabling automated quality assessment and structured analysis.

Instructions

对指定阶段内容执行 AI 打分,写入 scored 阶段。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes
source_stageNoraw
horizon_pathNo
config_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the 'score_items' service method which is invoked by the 'hz_score_items' MCP tool.
    async def score_items(
        self,
        run_id: str,
        source_stage: str = "raw",
        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)
        analyzer = ctx.runtime.ContentAnalyzer(ai_client)
        scored_items = await analyzer.analyze_batch(items)
    
        self.run_store.save_items(run_id, "scored", items_to_dicts(scored_items))
        score_threshold = ctx.config.filtering.ai_score_threshold
        above_threshold = [x for x in scored_items if x.ai_score and x.ai_score >= score_threshold]
    
        meta = self.run_store.update_meta(
            run_id,
            {
                "scored_count": len(scored_items),
                "scored_threshold": score_threshold,
                "scored_above_threshold": len(above_threshold),
            },
        )
    
        return {
            "run_id": run_id,
            "scored": len(scored_items),
            "above_threshold": len(above_threshold),
            "score_distribution": self._score_distribution(scored_items),
            "artifact": str((self.run_store.run_dir(run_id) / "scored_items.json").resolve()),
            "meta": meta,
        }
  • MCP tool registration for 'hz_score_items', mapping the tool name to the service.score_items handler.
    @mcp.tool()
    async def hz_score_items(
        run_id: str,
        source_stage: str = "raw",
        horizon_path: str | None = None,
        config_path: str | None = None,
    ) -> dict[str, Any]:
        """对指定阶段内容执行 AI 打分,写入 scored 阶段。"""
    
        return await _run_tool(
            "hz_score_items",
            lambda: service.score_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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that scoring is performed by AI and results are written to a 'scored' stage, but lacks details on permissions, rate limits, side effects (e.g., whether it modifies existing data), or error handling. This is inadequate for a tool that likely involves AI processing and data mutation.

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 a single, efficient sentence that directly states the tool's function. It is front-loaded with the core action and outcome, with no unnecessary words. However, it could be slightly more informative without sacrificing brevity.

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 the complexity of an AI scoring tool with 4 parameters, 0% schema coverage, no annotations, but an output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, parameter meanings, and usage context. The presence of an output schema mitigates the need to explain return values, but overall completeness is limited.

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 for undocumented parameters. It only vaguely references '指定阶段内容' (specified stage content), which might relate to 'source_stage', but fails to explain the purpose of 'run_id', 'horizon_path', or 'config_path'. This leaves most parameters without semantic clarification beyond their titles.

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 action ('执行 AI 打分' - perform AI scoring) and the target ('指定阶段内容' - specified stage content), with the outcome being writing to a 'scored' stage. It distinguishes from siblings like hz_enrich_items or hz_filter_items by focusing on scoring. However, it doesn't specify what exactly is being scored (e.g., items, data points), making it slightly less specific than a perfect 5.

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 like hz_enrich_items or hz_filter_items, nor does it mention prerequisites or context for invocation. It simply states what the tool does without indicating appropriate scenarios or exclusions.

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