eggsact 1.2.7

Deterministic MCP and in-process utility tools for coding agents
Documentation
use crate::mcp::registry::{ToolCost, ToolExposure, ToolSpec, ToolStability};
use crate::mcp::schemas::*;
use crate::tools::*;

pub const JSON_TOOLS: &[ToolSpec] = &[
    ToolSpec {
        name: "json_extract",
        description: "Extract a value from JSON using RFC 6901 JSON Pointer (e.g., /foo/bar/0). Navigate nested objects and arrays.",
        handler: json_extract,
        input_schema: json_extract_input,
        output_schema: json_extract_output,
        category: "json",
        tier: 2,
        profiles: &["full", "codegg_config"],
        tags: &["json", "structured-data", "extraction", "config", "pointer"],
        exposure: ToolExposure::Contextual,
        harness_use: &["none"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "json_compare",
        description: "Compare two JSON documents semantically, ignoring formatting and key order.",
        handler: json_compare,
        input_schema: json_compare_input,
        output_schema: json_compare_output,
        category: "json",
        tier: 1,
        profiles: &["full", "default", "codegg_config"],
        tags: &["json", "structured-data", "comparison", "config"],
        exposure: ToolExposure::Default,
        harness_use: &["config_preflight"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "json_shape",
        description: "Analyze the structure of a JSON document without returning values. Shows type, keys, and nested structure with configurable depth limits.",
        handler: json_shape_tool,
        input_schema: json_shape_input,
        output_schema: json_shape_output,
        category: "json",
        tier: 3,
        profiles: &["full", "codegg_repo_audit"],
        tags: &["json", "structured-data", "shape", "schema"],
        exposure: ToolExposure::ExpertOnly,
        harness_use: &["none"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "json_canonicalize",
        description: "Canonicalize JSON with deterministic formatting, key ordering, duplicate key detection, and stable hashes.",
        handler: json_canonicalize,
        input_schema: json_canonicalize_input,
        output_schema: json_canonicalize_output,
        category: "json",
        tier: 1,
        profiles: &["full", "default", "codegg_config"],
        tags: &["json", "canonical", "hash", "deterministic", "format"],
        exposure: ToolExposure::Default,
        harness_use: &["config_preflight"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Stable,
        composite: false,
    },
    ToolSpec {
        name: "json_query",
        description: "Extract a value from JSON using RFC 6901 JSON Pointer. Navigate nested objects and arrays. Deprecated: use json_extract instead, which provides richer output including available_keys, missing_at, and detail levels.",
        handler: json_query,
        input_schema: json_query_input,
        output_schema: json_query_output,
        category: "json",
        tier: 1,
        profiles: &["full"],
        tags: &["json", "pointer", "extraction", "query", "rfc6901"],
        exposure: ToolExposure::Contextual,
        harness_use: &["none"],
        aliases: &[],
        cost: ToolCost::Moderate,
        stability: ToolStability::Deprecated,
        composite: false,
    },
    ToolSpec {
        name: "structured_data_compare",
        description: "Composite: compare structured config/data output. Calls json_compare, json_canonicalize, and json_shape. Returns equal/not-equal verdict with structured diffs.",
        handler: structured_data_compare,
        input_schema: structured_data_compare_input,
        output_schema: structured_data_compare_output,
        category: "json",
        tier: 2,
        profiles: &["full", "codegg_core", "codegg_config"],
        tags: &["json", "comparison", "config", "structured-data", "composite"],
        exposure: ToolExposure::Contextual,
        harness_use: &["config_preflight"],
        aliases: &[],
        cost: ToolCost::Heavy,
        stability: ToolStability::Stable,
        composite: true,
    },
];