bendtherules 07a4d4957d feat(agent-tools/mcp-server): unify evaluate output schema and improve error handling
- Replace union output schema with a single combined schema containing optional fields for success and error cases, addressing MCP SDK limitation with union types.
- Add `importantSections`, `otherSections`, and `consoleOutput` as optional fields in the new schema.
- Update exported `outputSchema` and `EvaluateToolOutput` type to use the combined schema.
- Refactor execution logic to handle engine262's `ThrowCompletion_` instead of relying on thrown exceptions, extracting a readable error message.
- Adjust MCP server error detection to check `result.error !== undefined` rather than using the `in` operator.
- Update related comments and documentation to reflect the new schema design and error handling approach.
2026-04-14 11:12:17 +05:30
2026-03-27 17:47:12 +05:30
2026-04-13 18:46:55 +05:30
2026-04-03 11:04:40 +05:30
2026-04-13 18:46:55 +05:30

RAG Pipeline for Language Specification Exploration

This project implements a RAG-based AI chat agent to explore the ECMAScript specification and its implementation in engine262.

Prerequisites

  • Node.js: Version 18+
  • Ollama: Installed locally with an embedding model (e.g., nomic-embed-text)
  • OpenAI-compatible Endpoint: A hosted or local LLM service

Setup

  1. Install dependencies:

    bun install
    
  2. Prepare environment:

    export OPENAI_API_BASE="your_endpoint_base_url"
    export OPENAI_API_KEY="your_api_key"
    
  3. Clone specification: (Ensure ./spec-built/multipage contains the HTML files)

  4. Ingest data:

    bun run ingest
    

    Note: This will take significant time as it generates local embeddings via Ollama for both the spec and the implementation.

  5. Build graph:

    bun run build
    
  6. Run tests:

    bun test
    

Usage

Ask the agent questions about how code relates to the specification:

bun run agent "Explain how the 'if' statement works and show its implementation."

The agent will use tools to search the specification, explore the implementation code, and navigate the relationships between them using the graph.

S
Description
MCP server for exploring the ECMAScript specification
Readme
19 MiB
Languages
HTML 49%
JavaScript 32.7%
TypeScript 18.3%