kodegen_tools_introspection

Crates.iokodegen_tools_introspection
lib.rskodegen_tools_introspection
version0.10.10
created_at2025-11-03 17:19:17.253989+00
updated_at2026-01-02 15:05:43.280726+00
descriptionKODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents.
homepagehttps://kodegen.ai
repositoryhttps://github.com/cyrup-ai/kodegen-tools-introspection
max_upload_size
id1915005
size4,074,578
David Maple (kloudsamurai)

documentation

README

Kodegen AI Banner

kodegen-tools-introspection

Memory-efficient, Blazing-Fast MCP tools for code generation agents

Introspection tools for monitoring and debugging tool usage in AI agent systems. Part of the KODEGEN.ᴀɪ ecosystem.

Features

This MCP server provides two essential introspection tools:

🔍 inspect_tool_calls

Get chronological tool call history with full arguments and outputs.

Use cases:

  • Onboard new chat sessions by reviewing completed work
  • Recover context after chat history loss
  • Debug tool call sequences and execution flow
  • Navigate large tool histories with flexible pagination

Pagination support:

// First 50 calls (default)
{ "max_results": 50 }

// Last 20 calls (tail behavior)
{ "offset": -20 }

// Calls 50-99 (range)
{ "offset": 50, "max_results": 50 }

// Filter by tool name
{ "tool_name": "read_file", "offset": -10 }

// Filter by timestamp
{ "since": "2024-10-12T20:00:00Z" }

📊 inspect_usage_stats

Get comprehensive usage statistics and performance metrics.

Returns:

  • Total tool calls (successful and failed)
  • Success/failure rates
  • Breakdown by category (filesystem, terminal, edit, search, etc.)
  • Per-tool call counts
  • Session information and timestamps

Installation

Add to your Cargo.toml:

[dependencies]
kodegen_tools_introspection = "0.1"

Usage

Running the Server

# Development
cargo run

# Production
cargo build --release
./target/release/kodegen-introspection

As a Library

use kodegen_tools_introspection::{InspectUsageStatsTool, InspectToolCallsTool};

// Create tools
let usage_tool = InspectUsageStatsTool::new(usage_tracker);
let history_tool = InspectToolCallsTool::new();

// Register with MCP routers
let (tool_router, prompt_router) = register_tool(
    tool_router,
    prompt_router,
    usage_tool,
);

Example Client

cargo run --example introspection_demo

The example demonstrates:

  • Connecting to the local HTTP server
  • Calling both introspection tools
  • Logging requests/responses
  • Graceful shutdown

Building

# Build
cargo build

# Run tests
cargo test

# Lint
cargo clippy

# Format
cargo fmt

Architecture

  • Library (src/lib.rs): Exports tool implementations
  • Binary (src/main.rs): HTTP server using kodegen_server_http
  • History: Persisted to ~/.config/kodegen-mcp/tool-history.jsonl (last 1000 calls)

Requirements

  • Rust nightly toolchain
  • Components: rustfmt, clippy
  • Targets: x86_64-apple-darwin, wasm32-unknown-unknown

License

Licensed under either of:

  • Apache License, Version 2.0
  • MIT License

at your option.

Links

Commit count: 0

cargo fmt