hugging-bay-mcp 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,61 @@
1
1
  # hugging-bay-mcp
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/hugging-bay-mcp.svg)](https://www.npmjs.com/package/hugging-bay-mcp) [![MCP discovery tools](https://img.shields.io/badge/discovery%20tools-28-blue)](https://huggingbay.xyz/api/mcp)
4
+
3
5
  **Promise:** Find open model files with recorded SHA-256 and licence labels. Public reads need no account.<br>
4
- **Install:** `npx -y hugging-bay-mcp@0.1.8` (npm) · **Source candidate:** `0.1.9`<br>
6
+ **Install:** `npx -y hugging-bay-mcp@0.1.10`<br>
5
7
  **MCP config (remote):** `claude mcp add --transport http hugging-bay https://huggingbay.xyz/api/mcp`<br>
6
- **MCP config (stdio):** `{"mcpServers":{"hugging-bay":{"command":"npx","args":["-y","hugging-bay-mcp@0.1.8"],"env":{"HUGGING_BAY_API":"https://huggingbay.xyz"}}}}`<br>
8
+ **MCP config (stdio):** `{"mcpServers":{"hugging-bay":{"command":"npx","args":["-y","hugging-bay-mcp@0.1.10"],"env":{"HUGGING_BAY_API":"https://huggingbay.xyz"}}}}`<br>
7
9
  **First call:** `search_artifacts({ "q": "Qwen3 0.6B GGUF" })`<br>
8
10
  **Ask:** Missing a model, file, tool or feature? Ask with request_feature (hosted MCP) or POST https://huggingbay.xyz/api/v1/requests. No account. You get an id and can check its status. What shipped: https://huggingbay.xyz/changelog<br>
9
11
  [Changelog](https://huggingbay.xyz/changelog?ref=npm) · [MCP docs](https://huggingbay.xyz/agents?ref=npm)<br>
10
12
  **Keywords:** `gguf`, `local-llm`, `huggingface-alternative`, `mcp`
11
13
 
14
+ ## Claude Code, Codex CLI and Cursor
15
+
16
+ Public reads use no bearer token and need no OAuth login. Configure one transport
17
+ per server name. For Claude Code:
18
+
19
+ ```sh
20
+ claude mcp add --transport http hugging-bay https://huggingbay.xyz/api/mcp
21
+ claude mcp list
22
+ # Or use stdio under a separate name:
23
+ claude mcp add hugging-bay-stdio -- npx -y hugging-bay-mcp@0.1.10
24
+ ```
25
+
26
+ For Codex CLI:
27
+
28
+ ```sh
29
+ codex mcp add hugging-bay --url https://huggingbay.xyz/api/mcp
30
+ codex mcp list
31
+ ```
32
+
33
+ The equivalent entry in `~/.codex/config.toml` is:
34
+
35
+ ```toml
36
+ [mcp_servers.hugging-bay]
37
+ url = "https://huggingbay.xyz/api/mcp"
38
+ ```
39
+
40
+ For stdio, replace `url` with `command = "npx"` and
41
+ `args = ["-y", "hugging-bay-mcp@0.1.10"]`. Codex's MCP list reports configuration;
42
+ it does not prove a tool call succeeded. `auth_status: "unsupported"` describes
43
+ OAuth support, not a requirement to sign in for public reads.
44
+
45
+ For Cursor, merge this into `.cursor/mcp.json` (project) or `~/.cursor/mcp.json`:
46
+
47
+ ```json
48
+ {"mcpServers":{"hugging-bay":{"url":"https://huggingbay.xyz/api/mcp"}}}
49
+ ```
50
+
51
+ Use `tools/list` before calling a tool. The default discovery profile includes
52
+ `deployment_plan({"artifact":"<returned id>"})` for current file links and
53
+ hashes. `plan_local_deployment` belongs to the full profile. A successful search
54
+ or connection does not establish model availability, fit or a successful run.
55
+
12
56
  ## Profiles: stdio and hosted
13
57
 
14
- **What's new in 0.1.9:** the default stdio discovery profile matches hosted `/api/mcp` (28 tools, including board, requests, `get_model`, Teach reads, and `get_serve_decision`). **Source candidate:** `0.1.9` (npm still serves `0.1.8` until publish).
58
+ **Source candidate:** `0.1.11` adds typed MCP tool results, closed argument validation, and the shared 15-second wait budget across pacing and retries. It is not published; the install pins above stay on 0.1.10. Its default stdio discovery profile retains the 28-tool contract.
15
59
 
16
60
  The stdio launcher and hosted endpoint share the discovery profile. The package keeps
17
61
  the broader catalog available, but a client must opt into it explicitly:
@@ -19,7 +63,7 @@ the broader catalog available, but a client must opt into it explicitly:
19
63
  | Transport/profile | `tools/list` | What it is |
20
64
  | --- | --- | --- |
21
65
  | stdio default (`node packages/mcp/index.mjs`) | **28 tools** | same discovery profile as hosted `/api/mcp`; `tools/list` is the authority |
22
- | stdio `--profile full` | **106 tools** in 0.1.9 | the complete current stdio catalog; use `tools/list` as the authority rather than hard-coding the count |
66
+ | stdio `--profile full` | **107 tools** in the 0.1.11 source candidate | the complete current stdio catalog; use `tools/list` as the authority rather than hard-coding the count |
23
67
  | stdio `--profile verify` | **28 tools**; **29** with the run-proof flag | discovery plus `get_accepted_run_proof` when `HUGGING_BAY_MCP_ENABLE_UNRELEASED_RUN_PROOF=1` |
24
68
  | hosted `https://huggingbay.xyz/api/mcp` | **28 tools** | the deployed discovery profile; other hosted profiles use `?profile=` (see `https://huggingbay.xyz/.well-known/mcp.json`) |
25
69
 
@@ -28,10 +72,83 @@ The default is also selected when `HUGGING_BAY_MCP_PROFILE` is empty. Use
28
72
  catalog; a CLI profile takes precedence over the environment. Use
29
73
  `--profile discovery` to make the bounded choice explicit. Unknown profile
30
74
  values are refused with JSON-RPC `-32602` rather than silently changing the
31
- requested surface. Any tool outside the selected profile fails `tools/call`
32
- with `mcp_tool_not_in_profile`.
33
-
34
- ## Top tools
75
+ requested surface. Source tools outside the selected profile fail `tools/call`
76
+ with JSON-RPC `-32602` (`Unknown tool`).
77
+
78
+ ## Stdio arguments and protocol errors
79
+
80
+ The published npm **0.1.10 archive predates these argument and CLI fixes**.
81
+ The 0.1.11 source candidate includes the contract below.
82
+
83
+ `hugging-bay-mcp --help` (or `-h`) prints usage and exits successfully;
84
+ `--version` (or `-v`) prints the artifact version and exits successfully.
85
+ Neither command waits for stdin to close or calls the API.
86
+
87
+ Send JSON-RPC 2.0 messages over stdin/stdout. Newline and Content-Length
88
+ framing are supported. The supported revisions are `2025-06-18`,
89
+ `2025-11-25`, and `2026-07-28`. The 2025 revisions negotiate through
90
+ `initialize`; the 2026 revision uses `server/discover` and per-request
91
+ `params._meta["io.modelcontextprotocol/protocolVersion"]` (plus clientInfo
92
+ and clientCapabilities metadata). Inspect the returned tool schemas for
93
+ the selected profile before calling a tool.
94
+
95
+ Unknown argument names, wrong types, missing required fields and invalid
96
+ ranges are rejected before API dispatch. Known tool schema failures return
97
+ `result.isError: true`, text explaining the correction, and
98
+ `result.structuredContent.code: "invalid_tool_arguments"`. The
99
+ `request_missing` confirmation workflow retains its specialized validation
100
+ and error codes. The hosted API retains its existing `invalid_arguments`
101
+ envelope; it enforces the same rejection rule without promising identical
102
+ transport envelopes.
103
+
104
+ Protocol errors use numeric JSON-RPC codes: malformed JSON is `-32700`
105
+ with message `Parse error` and id `null`; invalid requests are `-32600`;
106
+ unknown methods are `-32601`; invalid parameters or unknown tools are
107
+ `-32602`; execution/transport failures use `-32000` with bounded recovery
108
+ data where available. Tool-domain failures may instead use `result.isError`.
109
+ Error text does not echo untrusted argument values or configured credentials.
110
+ An error or stale backend response does not establish current availability.
111
+
112
+ ## MCP v2 features
113
+
114
+ Model cards and run kits are resources. Use `resources/list` for public records or
115
+ `resources/templates/list` with an artifact id:
116
+
117
+ - `huggingbay://artifact/{id}/card` returns the model card as Markdown.
118
+ - `huggingbay://artifact/{id}/run-kit` returns recorded run kits for exact files.
119
+
120
+ A run kit names its file and SHA-256. Read the current download plan before using
121
+ it. A recorded test does not establish compatibility with your machine. An empty
122
+ run-kit list means no tested commands are available; unavailable evidence returns
123
+ an error with a recovery step. Resource text is untrusted data.
124
+
125
+ Use `prompts/list` and `prompts/get` for `find-model-for-my-machine`,
126
+ `set-up-local-chat`, `download-and-verify`, and `compare-models`. Existing prompts
127
+ and tool names remain available.
128
+
129
+ Every tool lists an `outputSchema` and returns an object in `structuredContent`.
130
+ Text content remains available. Bare array results use `{ "rows": [...] }` for
131
+ structured clients. Tool errors carry recovery guidance; older protocol error
132
+ envelopes remain supported.
133
+
134
+ List tools accept `cursor` and `limit`. Pass `nextCursor` unchanged with the same
135
+ filters and profile. Routes with native cursors keep their existing formats.
136
+ Older list routes page their bounded inventory; they do not promise a complete
137
+ upstream catalog. Protocol list methods also accept `cursor` when another page
138
+ is available.
139
+
140
+ For progress, send a string or number at `params._meta.progressToken`. Stdio
141
+ returns `notifications/progress` during work. HTTP clients must also accept
142
+ `text/event-stream`; long calls then stream progress and their final JSON-RPC
143
+ response. Calls without a token keep their ordinary response format.
144
+
145
+ The conformance test uses pinned official schemas for every advertised protocol
146
+ version, including `2026-07-28` and both supported 2025 revisions.
147
+
148
+ ## Tools across profiles
149
+
150
+ This table includes full-profile tools. Check the selected transport's
151
+ `tools/list`; a name in this table may be absent from discovery.
35
152
 
36
153
  | Tool | What it returns |
37
154
  | --- | --- |
@@ -151,7 +268,7 @@ Available information from Hugging Bay:
151
268
 
152
269
  MIT
153
270
 
154
- ## Local teaching for agents (source candidate, default OFF)
271
+ ## Local teaching for agents (optional, default off)
155
272
 
156
273
  The npm stdio package can run the installed local Teach engine. Set `HBAY_TEACH_LOCAL=1` and `HBAY_TEACH_PYTHON` to the Python executable in an environment with this source version of `hbay-teach` and its MLX or PEFT extra. The flag adds two local tools to the selected profile. The hosted MCP endpoint does not train models.
157
274
 
@@ -175,15 +292,15 @@ Downloadable doesn't mean tested: this record says whether the exact file can be
175
292
  The request-and-status sentence above is approved copy held on the c29 AEO-72/AEO-73 deployment gate. Verify the deployed `request_feature`, `get_request`, and public changelog/status path before package publication or directory copy uses it.
176
293
 
177
294
 
178
- ### Run a model on your computer (source preview)
295
+ ### Run a model on your computer (optional, default off)
179
296
 
180
- Start here: install the staged hbay binary and local MCP package below, then call `run_local` from your assistant. This is a source preview; no new package release is available yet.
297
+ Install hbay 0.2.0 or later and the local MCP package, then set `HUGGING_BAY_MCP_ENABLE_RUN_LOCAL=1` to expose `run_local` to your assistant. This feature runs on your computer; the hosted MCP does not start a model.
181
298
 
182
299
  #### 1. Set up the local tools
183
300
 
184
301
  Use a terminal on your own computer. You need both the native hbay program and the local MCP package before calling your assistant.
185
302
 
186
- Install the staged hbay 0.2.0 binary, then start this local npm stdio package with `HUGGING_BAY_MCP_ENABLE_RUN_LOCAL=1`. The flag defaults off. `HBAY_BINARY` may name a trusted local executable; `HBAY_DATA_DIR` may select an isolated data directory.
303
+ Install the hbay 0.2.0 or later binary, then start the local npm stdio package with `HUGGING_BAY_MCP_ENABLE_RUN_LOCAL=1`. The flag defaults off. `HBAY_BINARY` may name a trusted local executable; `HBAY_DATA_DIR` may select an isolated data directory.
187
304
 
188
305
  #### 2. Start one model
189
306
 
@@ -191,6 +308,45 @@ Call `run_local({"model":"Qwen/Qwen2.5-0.5B-Instruct-GGUF"})`. It checks for a r
191
308
 
192
309
  #### 3. Keep the session open
193
310
 
194
- One MCP process owns one model server. Close the MCP session to stop it. Cancelling a pending call, startup failure, or startup timeout also stops its child. Downloads may take up to 15 minutes before readiness. The hosted MCP, behind `HUGGING_BAY_RUN_LOCAL=1` (default off), returns local package setup steps and never starts a model on the hosted machine. No npm package or binary is published by this change.
311
+ One MCP process owns one model server. Close the MCP session to stop it. Cancelling a pending call, startup failure, or startup timeout also stops its child. Downloads may take up to 15 minutes before readiness. The hosted MCP, behind `HUGGING_BAY_RUN_LOCAL=1` (default off), returns local package setup steps and never starts a model on the hosted machine.
195
312
 
196
313
  Prompts stay on your machine.
314
+
315
+ ## Complete tool reference for agent builders
316
+
317
+ The expanded [MCP reference](https://huggingbay.xyz/docs/mcp) is staged behind
318
+ `HUGGING_BAY_AGENT_BUILDER_DOCS=1` (default off). With
319
+ `HUGGING_BAY_AGENT_GUARDRAILS=1`, the `verify-before-finish` MCP prompt is also
320
+ listed. It lists each hosted tool and
321
+ each source stdio tool separately, with profiles, purpose, inputs, outputs,
322
+ request templates, errors, and rate limits. Until that flag is enabled, use
323
+ [GET discovery](https://huggingbay.xyz/api/mcp/info) for hosted schemas and
324
+ `tools/list` on your installed package for stdio schemas. Do not assume that
325
+ source tools are published in the pinned npm release.
326
+
327
+ Hosted read-only tools still use POST for `tools/call`. GET discovery and REST
328
+ reads are sufficient to verify examples without invoking a production tool.
329
+ Check both JSON-RPC `error` and `result.isError`; prefer `structuredContent`
330
+ instead of parsing every text block as JSON. A successful result can abstain,
331
+ return no rows, or contain unknown facts.
332
+
333
+ The source stdio inventory is generated locally with no production requests:
334
+
335
+ ```bash
336
+ node apps/web/bin/generate-agent-mcp-stdio-reference.mjs
337
+ ```
338
+
339
+ The reference tests compare that inventory with all source profiles, including
340
+ local tools and accepted-run-proof opt-ins, and validate every argument example
341
+ against its tool schema.
342
+
343
+ Backing catalog reads follow the [shared backoff contract](../../docs/backoff-contract.md): at most two retries on 429/503, full Retry-After seconds or HTTP-date and JSON hints plus positive jitter, and a 15 second total wait budget. A longer delay is returned to the caller. Writes are never automatically replayed; only the known read-only get_model/get_serve_decision POST proxies opt into retries. Successful v1 Retry-After responses pace the next backing read.
344
+
345
+ ### Swarm helpers (source-only, opt in)
346
+
347
+ With `HUGGING_BAY_SWARM_FEATURES=1`, the explicit verify/full profiles add
348
+ `get_swarm_limits`, `get_snapshot`, `resolve_artifacts`, `deployment_plans`,
349
+ and `find_runnable_many`. Share the returned snapshot across every batch.
350
+ `swarm-client.mjs` also exports `createSwarmClient` for bounded parallel reads,
351
+ single-flight caching and shared Retry-After backoff. The discovery profile
352
+ stays unchanged. See [the quickstart](../../docs/swarm-quickstart.md).
@@ -1,7 +1,41 @@
1
1
  // Shared result shapes and output budgets for hosted and packaged MCP clients.
2
2
  // No transport, authorization, licence decisions, or census calculations live here.
3
+ import { SERVE_VERDICT_SCHEMA } from './serve-verdict.mjs';
4
+ import { PUBLIC_DESCRIPTION_WITHHELD } from "./public-note-copy.mjs";
5
+
3
6
  export const COMPACT_LIST_TOOLS = new Set(['search_artifacts', 'resolve_artifact', 'find_runnable', 'find_model', 'recommend_artifacts', 'recommend_safe_model', 'recommend_with_citation', 'find_ungated_alternatives', 'get_ranking', 'get_trending']);
4
7
 
8
+ /** Replace a withheld prose placeholder in find-runnable's top-level summary when pick facts remain. */
9
+ export function reconcileFindRunnablePublicSummary(doc) {
10
+ if (!doc || typeof doc !== "object" || Array.isArray(doc)) return doc;
11
+ if (doc.summary !== PUBLIC_DESCRIPTION_WITHHELD) return doc;
12
+ const pick = doc.recommendation;
13
+ if (pick && typeof pick === "object") {
14
+ const label = pick.repo || pick.name || pick.artifactId || pick.id;
15
+ if (typeof label === "string" && label) {
16
+ return { ...doc, summary: `Runnable pick: ${label}. Use structured fields and candidates for files and next steps.` };
17
+ }
18
+ }
19
+ const guidance = typeof doc.guidance === "string" ? doc.guidance : typeof doc.reason === "string" ? doc.reason : "";
20
+ if (guidance) {
21
+ const sentence = guidance.includes(".") ? `${guidance.split(".")[0]}.` : guidance;
22
+ return { ...doc, summary: sentence };
23
+ }
24
+ return doc;
25
+ }
26
+
27
+ // Use the same discovery projection in hosted and both stdio entrypoints. The
28
+ // full provider directory otherwise consumes the budget and drops endpoints.
29
+ export function compactAgentDiscovery(payload, sourceUrl = '') {
30
+ if (!payload || typeof payload !== 'object') return payload;
31
+ const keys = ['schemaVersion', 'name', 'generatedAt', 'status', 'purpose', 'askRequests', 'discovery', 'welcome', 'entrypoints', 'tasks', 'freshness', 'rateLimits', 'note'];
32
+ const doc = { ...Object.fromEntries(keys.filter(key => Object.hasOwn(payload, key)).map(key => [key, payload[key]])), details: { href: sourceUrl } };
33
+ if (payload.endpoints) doc.endpoints = Object.fromEntries(
34
+ ['remoteMcpDiscovery', 'remoteMcpJsonRpc', 'search', 'finder', 'artifactDownloadPlan', 'blackboard']
35
+ .filter(key => Object.hasOwn(payload.endpoints, key)).map(key => [key, payload.endpoints[key]]));
36
+ return boundMcpAnswer(doc, sourceUrl);
37
+ }
38
+
5
39
  export function boundMcpAnswer(payload, sourceUrl = "") {
6
40
  let doc = payload;
7
41
  if (Buffer.byteLength(JSON.stringify(doc)) <= 18000) return doc;
@@ -13,7 +47,7 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
13
47
  return value.slice(0, cap).map((item, i) => preview(item, `${path}/${i}`, cap));
14
48
  }
15
49
  if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([key, item]) =>
16
- [key, ['runKit', 'proofLab', 'testedRunPlan', 'receiptCard'].includes(key) ? item : preview(item, `${path}/${key}`, cap)]));
50
+ [key, ['oneAnswer', 'runKit', 'proofLab', 'testedRunPlan', 'receiptCard'].includes(key) ? item : preview(item, `${path}/${key}`, cap)]));
17
51
  if (typeof value === 'string' && value.length > 1200) {
18
52
  omissions.push({ path, omittedCharacters: value.length - 1200 });
19
53
  return value.slice(0, 1200);
@@ -24,7 +58,9 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
24
58
  if (Buffer.byteLength(JSON.stringify(doc)) > 16000) {
25
59
  doc = preview(doc, '', 1);
26
60
  }
27
- const protectedKeys = new Set(['id', 'artifactId', 'schemaVersion', 'counts', 'stats', 'total', 'cursor', 'nextCursor', 'note', 'license', 'licenseLabel', 'downloadable', 'downloadStatus', 'downloadReady', 'hosted', 'commandsAvailable', 'runReady']);
61
+ // c81: runKit, recommendation and getRunning are the answer itself (file, sha256, command); growing
62
+ // Proof Lab evidence must be trimmed before them, never them (live 22 Oct: /runKit was dropped).
63
+ const protectedKeys = new Set(['oneAnswer', 'signature_coverage', 'serve_verdict', 'local', 'fallback', 'id', 'artifactId', 'schemaVersion', 'counts', 'stats', 'total', 'cursor', 'nextCursor', 'note', 'license', 'licenseLabel', 'downloadable', 'downloadStatus', 'downloadReady', 'hosted', 'commandsAvailable', 'runReady', 'runKit', 'recommendation', 'getRunning']);
28
64
  // Keep the selected outcome and its proof together when the card fits the response budget.
29
65
  if (doc.receiptCard && Buffer.byteLength(JSON.stringify(doc.receiptCard)) <= 12000) protectedKeys.add('receiptCard');
30
66
  const largest = Object.keys(doc).filter(key => !protectedKeys.has(key))
@@ -43,6 +79,7 @@ export function boundMcpAnswer(payload, sourceUrl = "") {
43
79
  export const COMPACT_ARTIFACT_SCHEMA = {
44
80
  type: 'object', required: ['id', 'name', 'task', 'sizeBytes', 'licenseLabel', 'hosted', 'downloadable', 'details'],
45
81
  properties: {
82
+ serve_verdict: SERVE_VERDICT_SCHEMA,
46
83
  id: { type: 'string' }, name: { type: 'string' }, task: { type: ['string', 'null'] }, sizeBytes: { type: ['number', 'null'] },
47
84
  licenseLabel: { type: 'string' }, hosted: { type: ['boolean', 'null'] }, downloadable: { type: ['boolean', 'null'] },
48
85
  details: { type: 'object', required: ['href', 'tool'], properties: { href: { type: 'string' }, tool: { const: 'get_artifact' } } },
@@ -54,7 +91,7 @@ export function compactToolOutputSchema(name) {
54
91
  const row = { anyOf: [COMPACT_ARTIFACT_SCHEMA, { type: 'object', description: 'Full details when detail is full, or a separate service handoff.' }] };
55
92
  return { type: 'object', properties: {
56
93
  ...(name === 'search_artifacts' || name === 'get_ranking' || name === 'get_trending' ? { rows: { type: 'array', items: row }, total: { type: ['number', 'null'] }, nextCursor: { type: ['string', 'null'] } } : {}),
57
- ...(name === 'find_runnable' ? { recommendation: { anyOf: [row, { type: 'null' }] }, alternatives: { type: 'array', items: row } } : {}),
94
+ ...(name === 'find_runnable' ? { local: { enum: ['found', 'none_found', 'checking'] }, fallback: { type: 'object' }, recommendation: { anyOf: [row, { type: 'null' }] }, alternatives: { type: 'array', items: row } } : {}),
58
95
  note: { type: 'object', properties: { summary: { type: 'string' } } },
59
96
  }, additionalProperties: true };
60
97
  }
@@ -62,7 +99,7 @@ export function compactToolOutputSchema(name) {
62
99
  const MCP_TEXT_BUDGET_BYTES = 6000;
63
100
  const MCP_TEXT_PREVIEW_NOTE = "Text preview: lists and long text are shortened and some fields may be left out. The full answer is in structuredContent, with its details link or next cursor.";
64
101
  // Safety and identity fields stay in a preview whenever they fit.
65
- const MCP_TEXT_KEEP_FIRST = ["note", "schemaVersion", "id", "artifactId", "error", "status", "downloadable", "downloadStatus", "license", "licenseLabel", "degraded", "stale", "next", "details"];
102
+ const MCP_TEXT_KEEP_FIRST = ['signature_coverage', 'serve_verdict', 'local', 'fallback', "note", "schemaVersion", "id", "artifactId", "error", "status", "downloadable", "downloadStatus", "license", "licenseLabel", "degraded", "stale", "next", "details"];
66
103
  // Never shorten a value an agent could use as real: links and digests stay whole.
67
104
  const MCP_TEXT_EXACT_VALUE = /^(?:https?:\/\/|\/api\/)|^(?:sha256:)?(?:[a-f0-9]{40}|[a-f0-9]{64})$/i;
68
105
  // Identifiers, cursors, tokens, hashes and links are follow-up inputs; keep them whole.
@@ -112,8 +149,8 @@ export function mcpAnswerText(payload) {
112
149
 
113
150
  export function mcpAnswerSource(name, args, payload, base) {
114
151
  const id = args.id || args.artifact || payload?.artifactId || payload?.id;
115
- if (id && ['get_artifact', 'get_artifact_card', 'list_files', 'deployment_plan'].includes(name)) {
116
- const suffix = name === 'list_files' ? '/files' : name === 'get_artifact_card' ? '/card' : '';
152
+ if (id && ['get_artifact', 'get_artifact_card', 'get_harness_card', 'list_files', 'deployment_plan'].includes(name)) {
153
+ const suffix = name === 'list_files' ? '/files' : name === 'get_artifact_card' ? '/card' : name === 'get_harness_card' ? '/harness-card' : '';
117
154
  return new URL(`/api/v1/artifacts/${encodeURIComponent(id)}${suffix}`, base).href;
118
155
  }
119
156
  return payload?.apiUrl || new URL(name === 'get_agent_discovery' ? '/api/agent-discovery' : '/api/index.json', base).href;
@@ -585,7 +585,7 @@ export const HOSTED_DISCOVERY_EXTRA_TOOLS = [
585
585
  {
586
586
  "name": "get_model",
587
587
  "title": "Model file and license",
588
- "description": "Read the license label and commercial-use answer, estimated RAM for the recommended file, and whether an exact requested GGUF quant is hosted. Also returns current file details when available. Resolve a name first. Open the file's downloadUrl (/api/downloads): it re-checks and redirects to a signed link that lasts at most 300s (default 300, configurable shorter). Reopen for a fresh link. A URL is not permission.",
588
+ "description": "Read the license label and commercial-use answer, estimated RAM for the recommended file, and whether an exact requested GGUF quant is hosted. Includes runKit with tested commands when Hugging Bay has run that exact file and SHA-256; runTested is separate from download availability. Open the file's downloadUrl (/api/downloads): it re-checks and redirects to a signed link that lasts at most 300s (default 300, configurable shorter). Reopen for a fresh link. A URL is not permission.",
589
589
  "inputSchema": {
590
590
  "type": "object",
591
591
  "properties": {
@@ -618,7 +618,7 @@ export const HOSTED_DISCOVERY_EXTRA_TOOLS = [
618
618
  },
619
619
  {
620
620
  "name": "get_serve_decision",
621
- "description": "Return the ONE serve decision for an artifact — obtainReady, serveVerdict, reason codes and the plain reason — exactly as its download-plan reports it, so you never infer a verdict from several endpoints. Read-only; no key.",
621
+ "description": "Read one model’s current download decision and reason. Use when you need to check file availability. Example: {\"id\":\"model-id\"}. This read does not load or run a model.",
622
622
  "inputSchema": {
623
623
  "type": "object",
624
624
  "required": [