fix(search): stabilize brave mcp skill args

This commit is contained in:
zap
2026-03-10 19:53:37 +00:00
parent d98174b609
commit 610f2e40b8

View File

@@ -14,15 +14,15 @@ OPTS_JSON="$(printf '%s' "$OPTS_JSON_RAW" | jq -c '. // {}')"
ARGS_JSON="$(jq -cn --arg q "$QUERY" --arg opts "$OPTS_JSON" '
($opts | fromjson) as $o |
{
({
query: $q,
country: ($o.country // "US"),
search_lang: ($o.search_lang // "en"),
ui_lang: ($o.ui_lang // "en-US"),
count: ($o.count // 5),
freshness: ($o.freshness // empty),
safesearch: ($o.safesearch // empty)
count: ($o.count // 5)
}
+ (if ($o.freshness? // null) != null then {freshness: $o.freshness} else {} end)
+ (if ($o.safesearch? // null) != null then {safesearch: $o.safesearch} else {} end))
')"
RAW="$(mcporter call --allow-http "$URL.brave_web_search" --args "$ARGS_JSON" --output json)"