Skip to content
Merged
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
12 changes: 6 additions & 6 deletions qtype/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def index_files(
root_path: Path,
pattern: str,
type_label: str,
path_prefix: str,
process_content=None,
extract_title=None,
):
Expand All @@ -102,7 +101,7 @@ def index_files(
writer.add_document(
tantivy.Document(
title=title,
path=f"{path_prefix}/{rel_path}",
path=rel_path,
content=content,
type=type_label,
)
Expand All @@ -126,11 +125,10 @@ def resolve_for_indexing(content: str, file_path: Path) -> str:
docs_path,
"*.md",
"documentation",
"docs",
process_content=resolve_for_indexing,
extract_title=extract_md_title,
)
index_files(examples_path, "*.yaml", "example", "examples")
index_files(examples_path, "*.yaml", "example")

writer.commit()
return index
Expand Down Expand Up @@ -439,7 +437,8 @@ def list_examples() -> list[str]:
"Full-text search across all QType documentation and examples. "
"Returns matching documents and example YAML files ranked by relevance. "
"Use this to find documentation about specific topics, features, or components, "
"or to discover example implementations. Doc paths can be used with get_documentation."
"or to discover example implementations. Returned paths can be used directly "
"with get_documentation or get_example."
),
structured_output=True,
)
Expand All @@ -454,7 +453,8 @@ def search_library(query: str, limit: int = 10) -> list[dict[str, Any]]:
Returns:
List of matching items with:
- title: Item title
- path: Relative path (docs/ or examples/ prefix)
- path: Relative path (can be used directly with get_documentation
or get_example)
- type: Either "documentation" or "example"
- score: Relevance score (higher is more relevant)

Expand Down