Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ sources:
overlap_lines: 10
```

### Tools
### Search Tools

Each tool maps to a source and defines the MCP tool interface:
Each search tool maps to a source and defines the MCP tool interface:

```yaml
tools:
Expand All @@ -83,6 +83,36 @@ tools:
result_format: docs
```

### Collect Tools

Collect tools let agents write structured data back to the server. Unlike search tools, they don't query anything — they validate the agent's input against a YAML-defined schema and store it as JSONB in the database. Use them to gather signal from agents without writing any code.

The first built-in use case is search feedback: agents report whether search results were helpful, what they tried, and what went wrong. This surfaces broken or misleading documentation quickly. But collect tools are generic — you can define any schema for any use case (e.g., broken link reporting, feature requests, error logging).

```yaml
tools:
- name: submit-feedback
type: collect
description: "Submit feedback on whether search results were helpful."
response: "Feedback recorded. Thank you."
schema:
tool_name:
type: string
description: "Which search tool was used"
required: true
rating:
type: enum
values: ["helpful", "not_helpful"]
description: "Whether the results were helpful"
required: true
comment:
type: string
description: "What worked or didn't work"
required: true
```

Each field in `schema` supports `type` (`string`, `number`, or `enum`), an optional `description` (shown to the agent), `required` (defaults to false), and `values` (required for `enum` fields). The validated input is written as JSONB to the `collected_data` table along with the tool name and a timestamp.

### Built-in Chunker Types

| Type | Best For | Splits On |
Expand Down Expand Up @@ -187,6 +217,9 @@ docker compose up
# Seed index
docker compose exec app npx tsx scripts/seed-index.ts

# Run unit tests
npm test

# Test search
docker compose exec app npx tsx scripts/test-search.ts "your query"

Expand Down
21 changes: 21 additions & 0 deletions mcp-docs.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ tools:
max_limit: 20
result_format: docs

# Collect tools write structured data from agents to the database.
# Define input schema, description, and a canned response — no code needed.
- name: submit-feedback
type: collect
description: "Submit feedback on whether search results were helpful."
response: "Feedback recorded. Thank you."
schema:
tool_name:
type: string
description: "Which search tool was used"
required: true
rating:
type: enum
values: ["helpful", "not_helpful"]
description: "Whether the results were helpful"
required: true
comment:
type: string
description: "What worked or didn't work"
required: true

embedding:
provider: openai
model: text-embedding-3-small
Expand Down
23 changes: 23 additions & 0 deletions mcp-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,29 @@ tools:
max_limit: 20
result_format: code

- name: submit-feedback
type: collect
description: "After using search results, you can submit feedback on whether the advice worked or not. Report what you tried and whether it succeeded or failed. If something failed but you later found the missing information elsewhere, mention that too. This feedback helps improve search quality."
response: "Feedback recorded. Thank you."
schema:
tool_name:
type: string
description: "Which search tool was used"
required: true
query:
type: string
description: "The original search query"
required: true
rating:
type: enum
values: ["helpful", "not_helpful"]
description: "Whether the results were helpful"
required: true
comment:
type: string
description: "What was tried, what failed/worked, what info was missing"
required: true

embedding:
provider: openai
model: text-embedding-3-small
Expand Down
Loading