@cyanheads/protein-mcp-server 0.4.1 → 0.5.0
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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +5 -4
- package/changelog/0.4.x/0.4.2.md +16 -0
- package/changelog/0.5.x/0.5.0.md +19 -0
- package/dist/mcp-server/resources/definitions/af-summary.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/af-summary.resource.js +8 -1
- package/dist/mcp-server/resources/definitions/af-summary.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/_schemas.d.ts +25 -7
- package/dist/mcp-server/tools/definitions/_schemas.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/_schemas.js +42 -40
- package/dist/mcp-server/tools/definitions/_schemas.js.map +1 -1
- package/dist/mcp-server/tools/definitions/analyze-collection.tool.d.ts +9 -4
- package/dist/mcp-server/tools/definitions/analyze-collection.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/analyze-collection.tool.js +15 -5
- package/dist/mcp-server/tools/definitions/analyze-collection.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-structures.tool.d.ts +7 -0
- package/dist/mcp-server/tools/definitions/compare-structures.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/compare-structures.tool.js +76 -13
- package/dist/mcp-server/tools/definitions/compare-structures.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-structure.tool.js +18 -3
- package/dist/mcp-server/tools/definitions/get-structure.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-structures.tool.d.ts +5 -11
- package/dist/mcp-server/tools/definitions/search-structures.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-structures.tool.js +16 -4
- package/dist/mcp-server/tools/definitions/search-structures.tool.js.map +1 -1
- package/dist/services/alignment/alignment-service.d.ts +7 -0
- package/dist/services/alignment/alignment-service.d.ts.map +1 -1
- package/dist/services/alignment/alignment-service.js +22 -3
- package/dist/services/alignment/alignment-service.js.map +1 -1
- package/dist/services/foldseek/foldseek-service.d.ts +1 -1
- package/dist/services/foldseek/foldseek-service.d.ts.map +1 -1
- package/dist/services/foldseek/foldseek-service.js +5 -1
- package/dist/services/foldseek/foldseek-service.js.map +1 -1
- package/dist/services/rcsb/rcsb-service.d.ts.map +1 -1
- package/dist/services/rcsb/rcsb-service.js +12 -8
- package/dist/services/rcsb/rcsb-service.js.map +1 -1
- package/dist/services/rcsb/types.d.ts +10 -3
- package/dist/services/rcsb/types.d.ts.map +1 -1
- package/dist/services/shared/identifiers.d.ts +7 -0
- package/dist/services/shared/identifiers.d.ts.map +1 -1
- package/dist/services/shared/identifiers.js +14 -1
- package/dist/services/shared/identifiers.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** protein-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.5.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.5`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** protein-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.5.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.5`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/protein-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/protein-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -48,7 +48,7 @@ Federated search across experimental (PDB) and predicted (computed-model) struct
|
|
|
48
48
|
- Free-text, protein-sequence (triggers an mmseqs2 similarity search), and organism / method / resolution filters
|
|
49
49
|
- `content_type` scopes the search to `experimental`, `predicted`, or `all` — the default `all` is a genuine union of both universes, so computed models appear alongside PDB entries
|
|
50
50
|
- Every hit names its `source`; experimental hits are enriched with title, method, resolution, and organism, while computed models carry the UniProt accession parsed from their ID
|
|
51
|
-
- Optional `facets` return a method / organism / release-year breakdown alongside the hits at no extra call, each reporting how many matches carry no value for that dimension
|
|
51
|
+
- Optional `facets` return a method / organism / release-year breakdown alongside the hits at no extra call, each reporting how many matches carry no value for that dimension; each dimension may be listed once
|
|
52
52
|
- Chain hit IDs straight into `protein_get_structure`
|
|
53
53
|
|
|
54
54
|
---
|
|
@@ -96,9 +96,10 @@ Structural alignment of multiple structures (up to the configured `PROTEIN_MAX_C
|
|
|
96
96
|
- Methods: `tm-align`, `fatcat-rigid`, `fatcat-flexible`
|
|
97
97
|
- `reference: first` aligns every structure to the first; `reference: all_pairs` computes the full pairwise matrix
|
|
98
98
|
- Optional per-structure `chain` restricts the alignment to a single chain
|
|
99
|
+
- A structure repeated in `structures[]` is compared once — the repeat would only add a self-alignment and a mirrored pair, which the resume mechanism cannot tell apart from the original
|
|
99
100
|
- Each pair is an independent async job, fanned out with a concurrency cap and per-pair partial success — a pair still computing when the budget elapses returns `status: computing` with its job `uuid`, and a failed pair degrades its row without sinking the others
|
|
100
101
|
- Re-call with a matching `{ a, b, uuid }` entry in `resume[]` (copied from a prior response's `pairs[]`) to poll a computing pair's job instead of resubmitting
|
|
101
|
-
- Returns TM-score, RMSD, and aligned-residue count per pair
|
|
102
|
+
- Returns TM-score, RMSD, and aligned-residue count per pair, plus `modeledResidues` and `coverage` — each a `[a, b]` tuple, with coverage a 0–100 percentage of that structure's own modeled-residue count
|
|
102
103
|
|
|
103
104
|
---
|
|
104
105
|
|
|
@@ -107,7 +108,7 @@ Structural alignment of multiple structures (up to the configured `PROTEIN_MAX_C
|
|
|
107
108
|
Profile the PDB into distributions and trends over an optional scoping query — backed by RCSB's server-side facet engine (one call, compact buckets, no row pull).
|
|
108
109
|
|
|
109
110
|
- Group by `method`, `organism`, `polymer_type`, `resolution`, `release_year`, or `molecular_weight`
|
|
110
|
-
- One `group_by` dimension for a breakdown, or two for a cross-tab (the first nests the second)
|
|
111
|
+
- One `group_by` dimension for a breakdown, or two distinct dimensions for a cross-tab (the first nests the second); a repeated dimension is rejected
|
|
111
112
|
- `interval` sets the bin width for value histograms or the period for date histograms (`year` / `month` / `quarter`)
|
|
112
113
|
- Scope with a free-text `query`, `organism`, `method`, or `max_resolution`; `content_type` selects the structure universe
|
|
113
114
|
- `bucket_limit` caps buckets per dimension; truncation is flagged in the response
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "protein_find_similar's Foldseek identity score now returns a 0–1 fraction as declared, protein_get_structure and af:// no longer lose a whole predicted-source batch to one malformed ID, and protein_compare_structures reports per-structure modeled-residue count and coverage."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.2 — 2026-08-16
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`protein_compare_structures`** — each pair now reports `modeledResidues` and `coverage` tuples (`[a, b]`), coverage as a 0–100% of each structure's own modeled-residue count, both already present in the upstream alignment response. ([#23](https://github.com/cyanheads/protein-mcp-server/issues/23))
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
- **`protein_find_similar`** — Foldseek `identity` was passed through on Foldseek's 0–100 percentage scale despite the tool's declared 0–1 contract; normalized once at the service boundary. ([#24](https://github.com/cyanheads/protein-mcp-server/issues/24))
|
|
16
|
+
- **`protein_get_structure` / `af://`** — a `source: "predicted"` ID that was neither PDB- nor UniProt-shaped reached AlphaFold, came back 400, and sank the whole batch. Both now shape-check per ID so a malformed entry degrades only its own row; AlphaFold DB entry IDs (`AF-P69905-F1`) are accepted alongside bare accessions. ([#25](https://github.com/cyanheads/protein-mcp-server/issues/25))
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "protein_analyze_collection's nested facet child is now a single optional field instead of an array, and all three collection/comparison tools reject duplicate or ambiguous inputs with typed errors."
|
|
3
|
+
breaking: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.5.0 — 2026-08-16
|
|
7
|
+
|
|
8
|
+
## Changed
|
|
9
|
+
|
|
10
|
+
- **`protein_analyze_collection` facet output**: a bucket's nested cross-tab is now a single optional `child` object, replacing the `children[]` array that was always at most one element ([#28](https://github.com/cyanheads/protein-mcp-server/issues/28)). Breaking change to the tool's output schema.
|
|
11
|
+
- **`child` projection**: an empty `child` (empty `buckets[]`) is now emitted when the requested cross-tab dimension carries no upstream facet, so `child` present means a cross-tab was requested and `buckets: []` means it aggregated to nothing — previously both cases omitted `child` ([#31](https://github.com/cyanheads/protein-mcp-server/issues/31)).
|
|
12
|
+
- **`protein_search_structures` facet output**: switched to a flat facet schema, dropping the nested-child field the tool could never populate ([#34](https://github.com/cyanheads/protein-mcp-server/issues/34)). Breaking change to the tool's output schema.
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
- **`protein_analyze_collection`**: `group_by` now rejects a repeated dimension with a new `duplicate_dimension` error instead of silently deduping the cross-tab request ([#30](https://github.com/cyanheads/protein-mcp-server/issues/30)).
|
|
17
|
+
- **`protein_search_structures`**: `facets` now rejects a repeated dimension with the same `duplicate_dimension` error instead of returning the breakdown twice ([#35](https://github.com/cyanheads/protein-mcp-server/issues/35)).
|
|
18
|
+
- **`protein_compare_structures`**: repeated structures in `structures[]` are now de-duplicated before pairing, with a new `no_distinct_pair` error when fewer than two distinct structures remain — previously two pairs generated from a duplicate collapsed onto one resume key and one job's UUID was applied to both ([#33](https://github.com/cyanheads/protein-mcp-server/issues/33)).
|
|
19
|
+
- **`protein_compare_structures` `pairKey`**: now case-folds only the entry-ID portion of a structure label and preserves the chain suffix's case, since mmCIF `label_asym_id` is case-sensitive and chains `A` and `a` are different chains.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"af-summary.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/af-summary.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"af-summary.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/af-summary.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKrD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;6BA4D5B,CAAC"}
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* @module mcp-server/resources/definitions/af-summary.resource
|
|
7
7
|
*/
|
|
8
8
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
9
|
-
import { notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
9
|
+
import { invalidParams, notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
10
10
|
import { getAlphaFoldService } from '../../../services/alphafold/alphafold-service.js';
|
|
11
|
+
import { isAlphaFoldEntryId, isUniProtAccession } from '../../../services/shared/identifiers.js';
|
|
11
12
|
export const afSummaryResource = resource('af://{uniprot}', {
|
|
12
13
|
name: 'alphafold-structure-summary',
|
|
13
14
|
title: 'AlphaFold structure summary',
|
|
@@ -38,6 +39,12 @@ export const afSummaryResource = resource('af://{uniprot}', {
|
|
|
38
39
|
paeDocUrl: z.string().optional().describe('Predicted Aligned Error documentation URL.'),
|
|
39
40
|
}),
|
|
40
41
|
async handler(params, ctx) {
|
|
42
|
+
// AlphaFold answers a non-accession-shaped identifier with a 400 whose raw
|
|
43
|
+
// response body would otherwise surface verbatim; reject the shape locally.
|
|
44
|
+
// An AlphaFold DB entry ID resolves upstream too, and this resource emits one
|
|
45
|
+
// as `entryId`, so accept the form it hands back.
|
|
46
|
+
if (!isUniProtAccession(params.uniprot) && !isAlphaFoldEntryId(params.uniprot))
|
|
47
|
+
throw invalidParams(`"${params.uniprot}" is not a UniProt accession — af:// is keyed by UniProt accession (e.g. af://P69905) or an AlphaFold DB entry ID (e.g. af://AF-P69905-F1).`, { uniprot: params.uniprot });
|
|
41
48
|
const model = await getAlphaFoldService().getPrediction(params.uniprot, ctx);
|
|
42
49
|
if (!model)
|
|
43
50
|
throw notFound(`No AlphaFold model found for ${params.uniprot.toUpperCase()}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"af-summary.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/af-summary.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"af-summary.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/af-summary.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB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C,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* breakdown and a `content_type` scope — `protein_analyze_collection` and
|
|
4
4
|
* `protein_search_structures`. Facet nesting is bounded to two levels (a
|
|
5
5
|
* dimension's buckets may each carry one child dimension), matching the deepest
|
|
6
|
-
* cross-tab the facet engine produces
|
|
7
|
-
*
|
|
6
|
+
* cross-tab the facet engine produces; the flat variant drops the child position
|
|
7
|
+
* for the tool that requests single-dimension breakdowns only. Every dimension
|
|
8
|
+
* position also reports its coverage gap, so buckets that sum to less than the
|
|
9
|
+
* stated total say so.
|
|
8
10
|
* @module mcp-server/tools/definitions/_schemas
|
|
9
11
|
*/
|
|
10
12
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -20,15 +22,32 @@ export declare const CONTENT_TYPE_SCOPES: {
|
|
|
20
22
|
predicted: "computational"[];
|
|
21
23
|
all: ("computational" | "experimental")[];
|
|
22
24
|
};
|
|
23
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* A facet dimension whose buckets are flat — the shape for a tool that requests
|
|
27
|
+
* single-dimension breakdowns only, so no bucket can ever carry a cross-tab.
|
|
28
|
+
*/
|
|
29
|
+
export declare const flatFacetDimensionSchema: z.ZodObject<{
|
|
30
|
+
dimension: z.ZodString;
|
|
31
|
+
buckets: z.ZodArray<z.ZodObject<{
|
|
32
|
+
label: z.ZodString;
|
|
33
|
+
count: z.ZodNumber;
|
|
34
|
+
rangeFrom: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
rangeTo: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
missingValueCount: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
/** A facet dimension whose buckets may each carry one nested cross-tab dimension. */
|
|
24
41
|
export declare const facetDimensionSchema: z.ZodObject<{
|
|
25
42
|
dimension: z.ZodString;
|
|
43
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
missingValueCount: z.ZodNumber;
|
|
26
45
|
buckets: z.ZodArray<z.ZodObject<{
|
|
27
46
|
label: z.ZodString;
|
|
28
47
|
count: z.ZodNumber;
|
|
29
48
|
rangeFrom: z.ZodOptional<z.ZodNumber>;
|
|
30
49
|
rangeTo: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
|
|
50
|
+
child: z.ZodOptional<z.ZodObject<{
|
|
32
51
|
dimension: z.ZodString;
|
|
33
52
|
buckets: z.ZodArray<z.ZodObject<{
|
|
34
53
|
label: z.ZodString;
|
|
@@ -38,12 +57,11 @@ export declare const facetDimensionSchema: z.ZodObject<{
|
|
|
38
57
|
}, z.core.$strip>>;
|
|
39
58
|
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
40
59
|
missingValueCount: z.ZodNumber;
|
|
41
|
-
}, z.core.$strip
|
|
60
|
+
}, z.core.$strip>>;
|
|
42
61
|
}, z.core.$strip>>;
|
|
43
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
-
missingValueCount: z.ZodNumber;
|
|
45
62
|
}, z.core.$strip>;
|
|
46
63
|
export type FacetDimensionOutput = z.infer<typeof facetDimensionSchema>;
|
|
64
|
+
export type FlatFacetDimensionOutput = z.infer<typeof flatFacetDimensionSchema>;
|
|
47
65
|
/**
|
|
48
66
|
* Project a domain {@link FacetDimension} to the output shape, capping buckets.
|
|
49
67
|
* `total` is the population the buckets describe — the response total for a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_schemas.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"_schemas.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;CAIuC,CAAC;AAkDxE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAgBwB,CAAC;AAE9D,qFAAqF;AACrF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAI0D,CAAC;AAE5F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAgChF;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAwBtB;AA0CD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAoBrE;AAuDD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvF;AAED,sFAAsF;AACtF,eAAO,MAAM,iBAAiB;;;;;iBAWmD,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAM7E"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* breakdown and a `content_type` scope — `protein_analyze_collection` and
|
|
4
4
|
* `protein_search_structures`. Facet nesting is bounded to two levels (a
|
|
5
5
|
* dimension's buckets may each carry one child dimension), matching the deepest
|
|
6
|
-
* cross-tab the facet engine produces
|
|
7
|
-
*
|
|
6
|
+
* cross-tab the facet engine produces; the flat variant drops the child position
|
|
7
|
+
* for the tool that requests single-dimension breakdowns only. Every dimension
|
|
8
|
+
* position also reports its coverage gap, so buckets that sum to less than the
|
|
9
|
+
* stated total say so.
|
|
8
10
|
* @module mcp-server/tools/definitions/_schemas
|
|
9
11
|
*/
|
|
10
12
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -49,31 +51,23 @@ const childDimensionSchema = z
|
|
|
49
51
|
})
|
|
50
52
|
.describe('A nested cross-tab dimension within a parent bucket.');
|
|
51
53
|
/** A top-level facet bucket, optionally carrying a nested cross-tab dimension. */
|
|
52
|
-
const bucketSchema =
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
count: z.number().describe('Number of entries in the bucket.'),
|
|
56
|
-
rangeFrom: z
|
|
57
|
-
.number()
|
|
58
|
-
.optional()
|
|
59
|
-
.describe('Inclusive lower bound of a numeric histogram bin (= label). Present only for numeric facets (resolution, molecular_weight); absent for term/period facets.'),
|
|
60
|
-
rangeTo: z
|
|
61
|
-
.number()
|
|
62
|
-
.optional()
|
|
63
|
-
.describe('Exclusive upper bound of a numeric histogram bin (rangeFrom + bin interval), so the bin covers [rangeFrom, rangeTo). Present only for numeric facets.'),
|
|
64
|
-
children: z
|
|
65
|
-
.array(childDimensionSchema)
|
|
54
|
+
const bucketSchema = leafBucketSchema
|
|
55
|
+
.extend({
|
|
56
|
+
child: childDimensionSchema
|
|
66
57
|
.optional()
|
|
67
|
-
.describe('Nested dimension breakdown for cross-
|
|
58
|
+
.describe('Nested dimension breakdown for a cross-tab. Present whenever a second dimension was requested — with an empty bucket list when nothing in this bucket carries a value for it — so its absence means no cross-tab was asked for. At most one: a bucket is never cross-tabbed by more than one dimension.'),
|
|
68
59
|
})
|
|
69
60
|
.describe('A top-level aggregation bucket, optionally cross-tabbed by a nested dimension.');
|
|
70
|
-
/**
|
|
71
|
-
|
|
61
|
+
/**
|
|
62
|
+
* A facet dimension whose buckets are flat — the shape for a tool that requests
|
|
63
|
+
* single-dimension breakdowns only, so no bucket can ever carry a cross-tab.
|
|
64
|
+
*/
|
|
65
|
+
export const flatFacetDimensionSchema = z
|
|
72
66
|
.object({
|
|
73
67
|
dimension: z
|
|
74
68
|
.string()
|
|
75
69
|
.describe('Friendly dimension name (e.g. method, organism, release_year).'),
|
|
76
|
-
buckets: z.array(
|
|
70
|
+
buckets: z.array(leafBucketSchema).describe('Aggregation buckets, count-descending for terms.'),
|
|
77
71
|
truncated: z
|
|
78
72
|
.boolean()
|
|
79
73
|
.optional()
|
|
@@ -83,6 +77,12 @@ export const facetDimensionSchema = z
|
|
|
83
77
|
.describe('Matches in scope that carry no value for this attribute, so they count toward the response total but fall in no bucket (e.g. computed models have no experimental method; solution-NMR entries have no diffraction resolution). Independent of truncation — measured before the bucket cap is applied. 0 means no shortfall was detectable: a multi-valued attribute such as organism can place one match in several buckets, which offsets the shortfall rather than adding to it.'),
|
|
84
78
|
})
|
|
85
79
|
.describe('A facet dimension and its aggregation buckets.');
|
|
80
|
+
/** A facet dimension whose buckets may each carry one nested cross-tab dimension. */
|
|
81
|
+
export const facetDimensionSchema = flatFacetDimensionSchema
|
|
82
|
+
.extend({
|
|
83
|
+
buckets: z.array(bucketSchema).describe('Aggregation buckets, count-descending for terms.'),
|
|
84
|
+
})
|
|
85
|
+
.describe('A facet dimension and its aggregation buckets, each optionally cross-tabbed.');
|
|
86
86
|
/** Copy the numeric-histogram range onto an output bucket when present. */
|
|
87
87
|
function withRange(b) {
|
|
88
88
|
return b.rangeFrom !== undefined && b.rangeTo !== undefined
|
|
@@ -122,16 +122,16 @@ export function toFacetOutput(facet, cap, total) {
|
|
|
122
122
|
label: b.label,
|
|
123
123
|
count: b.count,
|
|
124
124
|
...withRange(b),
|
|
125
|
-
...(b.
|
|
125
|
+
...(b.child
|
|
126
126
|
? {
|
|
127
|
-
|
|
128
|
-
dimension:
|
|
129
|
-
buckets:
|
|
127
|
+
child: {
|
|
128
|
+
dimension: b.child.dimension,
|
|
129
|
+
buckets: b.child.buckets
|
|
130
130
|
.slice(0, cap)
|
|
131
131
|
.map((cb) => ({ label: cb.label, count: cb.count, ...withRange(cb) })),
|
|
132
|
-
...(
|
|
133
|
-
missingValueCount: missingValueCount(
|
|
134
|
-
}
|
|
132
|
+
...(b.child.buckets.length > cap ? { truncated: true } : {}),
|
|
133
|
+
missingValueCount: missingValueCount(b.child.buckets, b.count),
|
|
134
|
+
},
|
|
135
135
|
}
|
|
136
136
|
: {}),
|
|
137
137
|
})),
|
|
@@ -180,12 +180,13 @@ export function renderFacets(facets) {
|
|
|
180
180
|
}
|
|
181
181
|
for (const b of f.buckets) {
|
|
182
182
|
lines.push(`- ${renderBucket(b)}`);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
const c = b.child;
|
|
184
|
+
if (!c)
|
|
185
|
+
continue;
|
|
186
|
+
const inner = c.buckets.length === 0
|
|
187
|
+
? EMPTY_CHILD_DIMENSION_TEXT
|
|
188
|
+
: c.buckets.map(renderBucket).join(', ');
|
|
189
|
+
lines.push(` - ${c.dimension} → ${inner}${dimensionFlags(c)}`);
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
return lines;
|
|
@@ -221,13 +222,14 @@ function coveragePositions(facets, total) {
|
|
|
221
222
|
});
|
|
222
223
|
const children = new Map();
|
|
223
224
|
for (const b of f.buckets) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
const c = b.child;
|
|
226
|
+
if (!c)
|
|
227
|
+
continue;
|
|
228
|
+
const acc = children.get(c.dimension) ?? { missing: 0, scope: 0, bucketCount: 0 };
|
|
229
|
+
acc.missing += c.missingValueCount;
|
|
230
|
+
acc.scope += b.count;
|
|
231
|
+
acc.bucketCount += c.buckets.length;
|
|
232
|
+
children.set(c.dimension, acc);
|
|
231
233
|
}
|
|
232
234
|
for (const [dimension, acc] of children)
|
|
233
235
|
positions.push({ dimension, ...acc });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_schemas.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"_schemas.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY,EAAE,CAAC,cAAc,CAAC;IAC9B,SAAS,EAAE,CAAC,eAAe,CAAC;IAC5B,GAAG,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;CAC+B,CAAC;AAExE,kCAAkC;AAClC,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACpF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC9D,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4JAA4J,CAC7J;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,uJAAuJ,CACxJ;CACJ,CAAC;KACD,QAAQ,CAAC,yDAAyD,CAAC,CAAC;AAEvE,kEAAkE;AAClE,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;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AAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CACjE,CAAC;KACD,QAAQ,CAAC,oEAAoE,CAAC,CAAC;AAIlF,gGAAgG;AAChG,MAAM,UAAU,iBAAiB,CAAC,YAAiC;IACjE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -36,12 +36,14 @@ export declare const analyzeCollection: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
36
36
|
total: z.ZodNumber;
|
|
37
37
|
facets: z.ZodArray<z.ZodObject<{
|
|
38
38
|
dimension: z.ZodString;
|
|
39
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
missingValueCount: z.ZodNumber;
|
|
39
41
|
buckets: z.ZodArray<z.ZodObject<{
|
|
40
42
|
label: z.ZodString;
|
|
41
43
|
count: z.ZodNumber;
|
|
42
44
|
rangeFrom: z.ZodOptional<z.ZodNumber>;
|
|
43
45
|
rangeTo: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
|
|
46
|
+
child: z.ZodOptional<z.ZodObject<{
|
|
45
47
|
dimension: z.ZodString;
|
|
46
48
|
buckets: z.ZodArray<z.ZodObject<{
|
|
47
49
|
label: z.ZodString;
|
|
@@ -51,16 +53,19 @@ export declare const analyzeCollection: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
51
53
|
}, z.core.$strip>>;
|
|
52
54
|
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
53
55
|
missingValueCount: z.ZodNumber;
|
|
54
|
-
}, z.core.$strip
|
|
56
|
+
}, z.core.$strip>>;
|
|
55
57
|
}, z.core.$strip>>;
|
|
56
|
-
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
missingValueCount: z.ZodNumber;
|
|
58
58
|
}, z.core.$strip>>;
|
|
59
59
|
}, z.core.$strip>, readonly [{
|
|
60
60
|
readonly reason: "unknown_dimension";
|
|
61
61
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
62
62
|
readonly when: "A group_by value is outside the supported dimension set.";
|
|
63
63
|
readonly recovery: "Use a supported dimension: method, organism, polymer_type, resolution, release_year, or molecular_weight.";
|
|
64
|
+
}, {
|
|
65
|
+
readonly reason: "duplicate_dimension";
|
|
66
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
67
|
+
readonly when: "group_by lists the same dimension twice, which would cross a dimension with itself.";
|
|
68
|
+
readonly recovery: "List each dimension at most once: one dimension for a breakdown, or two distinct dimensions for a cross-tab.";
|
|
64
69
|
}], {
|
|
65
70
|
readonly scope: z.ZodOptional<z.ZodString>;
|
|
66
71
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-collection.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-collection.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwBjE,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"analyze-collection.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-collection.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwBjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwK5B,CAAC"}
|
|
@@ -25,7 +25,7 @@ export const analyzeCollection = tool('protein_analyze_collection', {
|
|
|
25
25
|
'organism, or polymer composition; resolution and molecular-weight histograms; release-year timelines; ' +
|
|
26
26
|
'and multidimensional cross-tabs (e.g. method × release_year). Aggregation runs server-side at RCSB — ' +
|
|
27
27
|
'one call returns compact buckets, no row pull. Pass one group_by dimension for a single breakdown, or ' +
|
|
28
|
-
'two for a cross-tab (the first nests the second).',
|
|
28
|
+
'two distinct dimensions for a cross-tab (the first nests the second).',
|
|
29
29
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
30
30
|
errors: [
|
|
31
31
|
{
|
|
@@ -34,13 +34,19 @@ export const analyzeCollection = tool('protein_analyze_collection', {
|
|
|
34
34
|
when: 'A group_by value is outside the supported dimension set.',
|
|
35
35
|
recovery: 'Use a supported dimension: method, organism, polymer_type, resolution, release_year, or molecular_weight.',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
reason: 'duplicate_dimension',
|
|
39
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
40
|
+
when: 'group_by lists the same dimension twice, which would cross a dimension with itself.',
|
|
41
|
+
recovery: 'List each dimension at most once: one dimension for a breakdown, or two distinct dimensions for a cross-tab.',
|
|
42
|
+
},
|
|
37
43
|
],
|
|
38
44
|
input: z.object({
|
|
39
45
|
group_by: z
|
|
40
46
|
.array(z.enum(FACET_DIMENSION_NAMES))
|
|
41
47
|
.min(1)
|
|
42
48
|
.max(2)
|
|
43
|
-
.describe('1 dimension for a breakdown, or 2 for a cross-tab (the first nests the second).'),
|
|
49
|
+
.describe('1 dimension for a breakdown, or 2 distinct dimensions for a cross-tab (the first nests the second). Repeating a dimension is rejected.'),
|
|
44
50
|
query: z
|
|
45
51
|
.string()
|
|
46
52
|
.optional()
|
|
@@ -104,6 +110,12 @@ export const analyzeCollection = tool('protein_analyze_collection', {
|
|
|
104
110
|
throw ctx.fail('unknown_dimension', 'group_by requires at least one dimension.', {
|
|
105
111
|
...ctx.recoveryFor('unknown_dimension'),
|
|
106
112
|
});
|
|
113
|
+
// A repeated dimension would nest a facet inside itself upstream. RCSB answers
|
|
114
|
+
// that with same-attribute overlap, not a cross-tab between two dimensions —
|
|
115
|
+
// an undocumented shape no caller can read, so reject before the call.
|
|
116
|
+
const duplicate = input.group_by.find((d, i, all) => all.indexOf(d) !== i);
|
|
117
|
+
if (duplicate)
|
|
118
|
+
throw ctx.fail('duplicate_dimension', `group_by lists "${duplicate}" twice; a cross-tab needs two distinct dimensions.`, { ...ctx.recoveryFor('duplicate_dimension') });
|
|
107
119
|
const spec = buildFacetSpec(primary, input.interval, secondary);
|
|
108
120
|
const { total, facets } = await rcsb.analyzeFacets({
|
|
109
121
|
...(input.query ? { text: input.query } : {}),
|
|
@@ -125,9 +137,7 @@ export const analyzeCollection = tool('protein_analyze_collection', {
|
|
|
125
137
|
notices.push(`One or more dimensions exceeded ${cap} buckets and were capped; scope the query tighter for the long tail.`);
|
|
126
138
|
}
|
|
127
139
|
if (input.content_type === 'predicted') {
|
|
128
|
-
|
|
129
|
-
// method" would read as two findings.
|
|
130
|
-
const blind = [...new Set(input.group_by.filter((d) => EXPERIMENTAL_ONLY_DIMENSIONS.has(d)))];
|
|
140
|
+
const blind = input.group_by.filter((d) => EXPERIMENTAL_ONLY_DIMENSIONS.has(d));
|
|
131
141
|
if (blind.length > 0) {
|
|
132
142
|
notices.push(`${blind.join(' and ')} ${blind.length > 1 ? 'are' : 'is'} empty under content_type "predicted": computed models carry no experimental method or resolution metadata. Use content_type "experimental" or "all", or group by organism, polymer_type, release_year, or molecular_weight.`);
|
|
133
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-collection.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-collection.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAqB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IAClE,KAAK,EAAE,wCAAwC;IAC/C,WAAW,EACT,kGAAkG;QAClG,wGAAwG;QACxG,uGAAuG;QACvG,wGAAwG;QACxG,
|
|
1
|
+
{"version":3,"file":"analyze-collection.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-collection.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAqB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CA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AAC"}
|
|
@@ -44,6 +44,8 @@ export declare const compareStructures: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
44
44
|
tmScore: z.ZodOptional<z.ZodNumber>;
|
|
45
45
|
rmsd: z.ZodOptional<z.ZodNumber>;
|
|
46
46
|
alignedResidues: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
modeledResidues: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
48
|
+
coverage: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
47
49
|
uuid: z.ZodOptional<z.ZodString>;
|
|
48
50
|
error: z.ZodOptional<z.ZodString>;
|
|
49
51
|
}, z.core.$strip>>;
|
|
@@ -52,6 +54,11 @@ export declare const compareStructures: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
52
54
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
53
55
|
readonly when: "A resume entry's a/b labels don't match any pair generated from structures + reference.";
|
|
54
56
|
readonly recovery: "Copy each resume entry's a, b, and uuid verbatim from a prior response's pairs[], and keep structures and reference unchanged between calls.";
|
|
57
|
+
}, {
|
|
58
|
+
readonly reason: "no_distinct_pair";
|
|
59
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
60
|
+
readonly when: "Every entry in structures[] denotes the same structure, leaving no pair to align.";
|
|
61
|
+
readonly recovery: "Pass at least two different structures (entry ID, or entry ID + chain); a structure repeated in the list is compared once.";
|
|
55
62
|
}], {
|
|
56
63
|
readonly pairsTotal: z.ZodNumber;
|
|
57
64
|
readonly computing: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-structures.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-structures.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"compare-structures.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-structures.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsHjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmK5B,CAAC"}
|