MCPcopy Create free account
hub / github.com/Open-Quant/openquant / afml_search

Function afml_search

scripts/afml_mcp_server.py:198–227  ·  view source on GitHub ↗
(
    query: str,
    top_k: int = 8,
    chapter: str = "",
    section: str = "",
    semantic_weight: float = 0.86,
    include_text: bool = True,
)

Source from the content-addressed store, hash-verified

196 ),
197)
198def afml_search(
199 query: str,
200 top_k: int = 8,
201 chapter: str = "",
202 section: str = "",
203 semantic_weight: float = 0.86,
204 include_text: bool = True,
205) -> dict[str, Any]:
206 if top_k < 1:
207 top_k = 1
208 if top_k > 50:
209 top_k = 50
210
211 results = _score_results(
212 query=query,
213 top_k=top_k,
214 chapter=chapter,
215 section=section,
216 semantic_weight=semantic_weight,
217 )
218 if not include_text:
219 for r in results:
220 r.pop("text", None)
221
222 return {
223 "query": query,
224 "top_k": top_k,
225 "filters": {"chapter": chapter, "section": section},
226 "results": results,
227 }
228
229
230@mcp.tool(

Callers 2

build_stateFunction · 0.90
cmd_evidenceFunction · 0.90

Calls 1

_score_resultsFunction · 0.85

Tested by

no test coverage detected