@cyanheads/brapi-mcp-server 0.7.13 → 0.8.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.
Files changed (54) hide show
  1. package/AGENTS.md +15 -8
  2. package/CLAUDE.md +15 -8
  3. package/README.md +206 -240
  4. package/changelog/0.8.x/0.8.0.md +48 -0
  5. package/dist/config/alias-credentials.d.ts +28 -7
  6. package/dist/config/alias-credentials.d.ts.map +1 -1
  7. package/dist/config/alias-credentials.js +91 -24
  8. package/dist/config/alias-credentials.js.map +1 -1
  9. package/dist/config/builtin-aliases.d.ts +11 -6
  10. package/dist/config/builtin-aliases.d.ts.map +1 -1
  11. package/dist/config/builtin-aliases.js +23 -37
  12. package/dist/config/builtin-aliases.js.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp-server/resources/definitions/brapi-server-info.resource.js +1 -1
  16. package/dist/mcp-server/resources/definitions/brapi-server-info.resource.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts +46 -0
  18. package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/brapi-connect.tool.js +65 -15
  20. package/dist/mcp-server/tools/definitions/brapi-connect.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.js +7 -2
  23. package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts +12 -0
  25. package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts.map +1 -1
  26. package/dist/mcp-server/tools/definitions/brapi-server-info.tool.js +1 -1
  27. package/dist/mcp-server/tools/definitions/brapi-server-info.tool.js.map +1 -1
  28. package/dist/mcp-server/tools/definitions/index.d.ts +123 -65
  29. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  30. package/dist/mcp-server/tools/shared/find-helpers.d.ts +6 -0
  31. package/dist/mcp-server/tools/shared/find-helpers.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/shared/find-helpers.js +17 -5
  33. package/dist/mcp-server/tools/shared/find-helpers.js.map +1 -1
  34. package/dist/mcp-server/tools/shared/orientation-envelope.d.ts +26 -0
  35. package/dist/mcp-server/tools/shared/orientation-envelope.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/shared/orientation-envelope.js +75 -6
  37. package/dist/mcp-server/tools/shared/orientation-envelope.js.map +1 -1
  38. package/dist/services/brapi-client/brapi-client.d.ts.map +1 -1
  39. package/dist/services/brapi-client/brapi-client.js +29 -26
  40. package/dist/services/brapi-client/brapi-client.js.map +1 -1
  41. package/dist/services/capability-registry/capability-registry.d.ts +8 -1
  42. package/dist/services/capability-registry/capability-registry.d.ts.map +1 -1
  43. package/dist/services/capability-registry/capability-registry.js +37 -6
  44. package/dist/services/capability-registry/capability-registry.js.map +1 -1
  45. package/dist/services/reference-data-cache/reference-data-cache.d.ts.map +1 -1
  46. package/dist/services/reference-data-cache/reference-data-cache.js +9 -4
  47. package/dist/services/reference-data-cache/reference-data-cache.js.map +1 -1
  48. package/dist/services/server-registry/server-registry.d.ts +17 -3
  49. package/dist/services/server-registry/server-registry.d.ts.map +1 -1
  50. package/dist/services/server-registry/server-registry.js +30 -4
  51. package/dist/services/server-registry/server-registry.js.map +1 -1
  52. package/manifest.json +1 -1
  53. package/package.json +2 -2
  54. package/server.json +3 -3
@@ -87,17 +87,63 @@ export declare const brapiConnect: import("@cyanheads/mcp-ts-core").ToolDefiniti
87
87
  citation: z.ZodString;
88
88
  isDemo: z.ZodOptional<z.ZodBoolean>;
89
89
  }, z.core.$strip>>;
90
+ nextToolSuggestions: z.ZodArray<z.ZodObject<{
91
+ toolName: z.ZodEnum<{
92
+ brapi_find_germplasm: "brapi_find_germplasm";
93
+ brapi_find_locations: "brapi_find_locations";
94
+ brapi_find_studies: "brapi_find_studies";
95
+ brapi_find_variables: "brapi_find_variables";
96
+ }>;
97
+ reason: z.ZodString;
98
+ args: z.ZodObject<{
99
+ alias: z.ZodString;
100
+ }, z.core.$strip>;
101
+ }, z.core.$strip>>;
90
102
  notes: z.ZodArray<z.ZodString>;
91
103
  fetchedAt: z.ZodString;
92
104
  }, z.core.$strip>, readonly [{
105
+ readonly reason: 'auth_session_required';
106
+ readonly code: JsonRpcErrorCode.Forbidden;
107
+ readonly when: 'Caller-supplied credentials on an HTTP deployment without per-user auth, from a request that carries no MCP session';
108
+ readonly recovery: 'Connect from a client that keeps an MCP session (2025-era Streamable HTTP) or over stdio, use a deployment with MCP_AUTH_MODE=jwt or oauth, or omit `auth` to use server-configured credentials or none.';
109
+ readonly retryable: false;
110
+ }, {
111
+ readonly reason: 'auth_base_url_mismatch';
112
+ readonly code: JsonRpcErrorCode.Forbidden;
113
+ readonly when: 'The alias has server-configured credentials and the supplied baseUrl differs from the server configured for it';
114
+ readonly recovery: "Omit `baseUrl` to connect to the server configured for this alias, or register the other server under a different alias.";
115
+ readonly retryable: false;
116
+ readonly thrownBy: 'service';
117
+ }, {
118
+ readonly reason: 'alias_base_url_unset';
119
+ readonly code: JsonRpcErrorCode.ConfigurationError;
120
+ readonly when: 'The alias has server-configured credentials but no base URL of its own (no BRAPI_<ALIAS>_BASE_URL and no enabled built-in), so they pair with no server';
121
+ readonly recovery: 'Set BRAPI_<ALIAS>_BASE_URL on the server for this alias, or remove its credential variables, before retrying.';
122
+ readonly retryable: false;
123
+ readonly thrownBy: 'service';
124
+ }, {
93
125
  readonly reason: 'auth_token_exchange_failed';
94
126
  readonly code: JsonRpcErrorCode.Forbidden;
95
127
  readonly when: 'SGN or OAuth token exchange against the BrAPI /token endpoint failed';
96
128
  readonly recovery: 'Verify the credentials and that the server exposes /token before retrying.';
129
+ readonly thrownBy: 'service';
97
130
  }, {
98
131
  readonly reason: 'auth_no_access_token';
99
132
  readonly code: JsonRpcErrorCode.Forbidden;
100
133
  readonly when: 'Token endpoint responded but did not return an access_token';
101
134
  readonly recovery: 'Confirm the credentials are valid and the upstream IdP issues access tokens for this grant.';
135
+ readonly thrownBy: 'service';
136
+ }, {
137
+ readonly reason: 'upstream_unauthorized';
138
+ readonly code: JsonRpcErrorCode.Unauthorized;
139
+ readonly when: 'The server answered HTTP 401 on /serverinfo or /calls — it requires login for capability discovery';
140
+ readonly recovery: 'Retry brapi_connect with credentials in `auth` (sgn, bearer, api_key, or oauth2), or ask the operator to configure credentials for this alias server-side.';
141
+ readonly thrownBy: 'service';
142
+ }, {
143
+ readonly reason: 'upstream_forbidden';
144
+ readonly code: JsonRpcErrorCode.Forbidden;
145
+ readonly when: 'The server answered HTTP 403 on /serverinfo or /calls — the request (anonymous or credentialed) lacks read access';
146
+ readonly recovery: 'Retry brapi_connect with credentials that have read access to this server, or ask the operator to configure such credentials for this alias server-side.';
147
+ readonly thrownBy: 'service';
102
148
  }], undefined>;
103
149
  //# sourceMappingURL=brapi-connect.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-connect.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqBjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAWX,4BAA4B;;mBAE9B,sEAAsE;uBAClE,4EAA4E;;qBAG9E,sBAAsB;;mBAExB,6DAA6D;uBAEjE,6FAA6F;cAoEnG,CAAC"}
1
+ {"version":3,"file":"brapi-connect.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyBjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAWX,uBAAuB;;mBAEzB,qHAAqH;uBAEzH,0MAA0M;;;qBAIpM,wBAAwB;;mBAE1B,gHAAgH;;;uBAG5G,SAAS;;qBAGX,sBAAsB;;mBAExB,yJAAyJ;uBAE7J,+GAA+G;;uBAEvG,SAAS;;qBAGX,4BAA4B;;mBAE9B,sEAAsE;uBAClE,4EAA4E;uBAC5E,SAAS;;qBAGX,sBAAsB;;mBAExB,6DAA6D;uBAEjE,6FAA6F;uBACrF,SAAS;;qBAGX,uBAAuB;;mBAEzB,oGAAoG;uBAExG,4JAA4J;uBACpJ,SAAS;;qBAGX,oBAAoB;;mBAEtB,mHAAmH;uBAEvH,0JAA0J;uBAClJ,SAAS;cAwFvB,CAAC"}
@@ -8,14 +8,15 @@
8
8
  * @module mcp-server/tools/definitions/brapi-connect.tool
9
9
  */
10
10
  import { tool, z } from '@cyanheads/mcp-ts-core';
11
+ import { config } from '@cyanheads/mcp-ts-core/config';
11
12
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
12
- import { discoverConfiguredAliases, formatConfiguredAliasesHint, resolveConnectInput, } from '../../../config/alias-credentials.js';
13
+ import { AUTH_BASE_URL_MISMATCH_RECOVERY, discoverConfiguredAliases, formatConfiguredAliasesHint, resolveConnectInput, } from '../../../config/alias-credentials.js';
13
14
  import { getBrapiClient } from '../../../services/brapi-client/index.js';
14
- import { getCapabilityRegistry } from '../../../services/capability-registry/index.js';
15
+ import { getCapabilityRegistry, } from '../../../services/capability-registry/index.js';
15
16
  import { getServerRegistry } from '../../../services/server-registry/index.js';
16
17
  import { ConnectAuthSchema } from '../shared/connect-auth-schema.js';
17
18
  import { buildOrientationEnvelope, formatOrientationEnvelope, OrientationEnvelopeSchema, } from '../shared/orientation-envelope.js';
18
- const BASE_DESCRIPTION = 'Open a connection to a BrAPI v2 server, authenticate, and return the full orientation envelope (server identity, capability profile, content summary). Required handshake before other BrAPI tools. Supports multiple concurrent connections via named aliases. Credentials can be configured server-side and omitted from this call.';
19
+ const BASE_DESCRIPTION = 'Open a connection to a BrAPI v2 server, authenticate, and return the full orientation envelope (server identity, capability profile, content summary, suggested next tools). Required handshake before other BrAPI tools. Supports multiple concurrent connections via named aliases. Credentials can be configured server-side and omitted from this call. When a request carries no MCP session on a deployment without per-user auth, aliases live in one namespace shared by every such caller: re-registering an alias re-points their later calls to it.';
19
20
  const CONFIGURED_ALIASES_HINT = formatConfiguredAliasesHint(discoverConfiguredAliases());
20
21
  export const brapiConnect = tool('brapi_connect', {
21
22
  description: CONFIGURED_ALIASES_HINT
@@ -27,17 +28,56 @@ export const brapiConnect = tool('brapi_connect', {
27
28
  idempotentHint: true,
28
29
  },
29
30
  errors: [
31
+ {
32
+ reason: 'auth_session_required',
33
+ code: JsonRpcErrorCode.Forbidden,
34
+ when: 'Caller-supplied credentials on an HTTP deployment without per-user auth, from a request that carries no MCP session',
35
+ recovery: 'Connect from a client that keeps an MCP session (2025-era Streamable HTTP) or over stdio, use a deployment with MCP_AUTH_MODE=jwt or oauth, or omit `auth` to use server-configured credentials or none.',
36
+ retryable: false,
37
+ },
38
+ {
39
+ reason: 'auth_base_url_mismatch',
40
+ code: JsonRpcErrorCode.Forbidden,
41
+ when: 'The alias has server-configured credentials and the supplied baseUrl differs from the server configured for it',
42
+ recovery: AUTH_BASE_URL_MISMATCH_RECOVERY,
43
+ retryable: false,
44
+ thrownBy: 'service',
45
+ },
46
+ {
47
+ reason: 'alias_base_url_unset',
48
+ code: JsonRpcErrorCode.ConfigurationError,
49
+ when: 'The alias has server-configured credentials but no base URL of its own (no BRAPI_<ALIAS>_BASE_URL and no enabled built-in), so they pair with no server',
50
+ recovery: 'Set BRAPI_<ALIAS>_BASE_URL on the server for this alias, or remove its credential variables, before retrying.',
51
+ retryable: false,
52
+ thrownBy: 'service',
53
+ },
30
54
  {
31
55
  reason: 'auth_token_exchange_failed',
32
56
  code: JsonRpcErrorCode.Forbidden,
33
57
  when: 'SGN or OAuth token exchange against the BrAPI /token endpoint failed',
34
58
  recovery: 'Verify the credentials and that the server exposes /token before retrying.',
59
+ thrownBy: 'service',
35
60
  },
36
61
  {
37
62
  reason: 'auth_no_access_token',
38
63
  code: JsonRpcErrorCode.Forbidden,
39
64
  when: 'Token endpoint responded but did not return an access_token',
40
65
  recovery: 'Confirm the credentials are valid and the upstream IdP issues access tokens for this grant.',
66
+ thrownBy: 'service',
67
+ },
68
+ {
69
+ reason: 'upstream_unauthorized',
70
+ code: JsonRpcErrorCode.Unauthorized,
71
+ when: 'The server answered HTTP 401 on /serverinfo or /calls — it requires login for capability discovery',
72
+ recovery: 'Retry brapi_connect with credentials in `auth` (sgn, bearer, api_key, or oauth2), or ask the operator to configure credentials for this alias server-side.',
73
+ thrownBy: 'service',
74
+ },
75
+ {
76
+ reason: 'upstream_forbidden',
77
+ code: JsonRpcErrorCode.Forbidden,
78
+ when: 'The server answered HTTP 403 on /serverinfo or /calls — the request (anonymous or credentialed) lacks read access',
79
+ recovery: 'Retry brapi_connect with credentials that have read access to this server, or ask the operator to configure such credentials for this alias server-side.',
80
+ thrownBy: 'service',
41
81
  },
42
82
  ],
43
83
  input: z.object({
@@ -57,32 +97,46 @@ export const brapiConnect = tool('brapi_connect', {
57
97
  const registry = getServerRegistry();
58
98
  const capabilities = getCapabilityRegistry();
59
99
  const client = getBrapiClient();
100
+ // Credentialed state fails closed: without a session or per-user auth the
101
+ // exchanged header would sit where every other session-less caller reads it.
102
+ if (input.auth &&
103
+ input.auth.mode !== 'none' &&
104
+ isSharedTenantHttp() &&
105
+ registry.isolationFallsBackToShared(ctx)) {
106
+ throw ctx.fail('auth_session_required', 'Caller-supplied credentials are refused: this HTTP deployment has no per-user auth and the request carries no MCP session, so the connection would be shared with every other session-less caller.', { ...ctx.recoveryFor('auth_session_required') });
107
+ }
60
108
  const resolved = resolveConnectInput(input.alias, {
61
109
  baseUrl: input.baseUrl,
62
110
  auth: input.auth,
63
111
  });
64
- const connection = await registry.register(ctx, {
112
+ // Nothing persists until the connection has proven itself: token exchange
113
+ // and a fresh capability fetch run first, so any failure leaves the previous
114
+ // registration under this alias (and its cached profile) as it was.
115
+ const connection = await registry.resolve(ctx, {
65
116
  alias: input.alias,
66
117
  baseUrl: resolved.baseUrl,
67
118
  auth: resolved.auth,
68
119
  });
120
+ const profileLookup = { forceRefresh: true };
121
+ if (connection.resolvedAuth)
122
+ profileLookup.auth = connection.resolvedAuth;
123
+ await capabilities.profile(connection.baseUrl, ctx, profileLookup);
124
+ await registry.save(ctx, connection);
69
125
  ctx.log.info('BrAPI connection registered', {
70
126
  alias: connection.alias,
71
127
  baseUrl: connection.baseUrl,
72
128
  authMode: connection.authMode,
73
129
  authSource: input.auth ? 'agent' : 'env',
74
130
  });
75
- if (isMultiTenantHttpDeployment() && connection.authMode !== 'none') {
131
+ if (isSharedTenantHttp() && connection.authMode !== 'none') {
76
132
  ctx.log.notice('Connection credentials persisted under shared `default` tenant — set MCP_AUTH_MODE=jwt|oauth for per-client isolation.', {
77
133
  alias: connection.alias,
78
134
  baseUrl: connection.baseUrl,
79
135
  authMode: connection.authMode,
80
- mcpTransport: process.env.MCP_TRANSPORT_TYPE,
81
- mcpAuthMode: process.env.MCP_AUTH_MODE ?? 'none',
136
+ mcpTransport: config.mcpTransportType,
137
+ mcpAuthMode: config.mcpAuthMode,
82
138
  });
83
139
  }
84
- // Force a fresh capability load on connect — the agent expects current state.
85
- await capabilities.invalidate(connection.baseUrl, ctx);
86
140
  return buildOrientationEnvelope(ctx, connection, {
87
141
  registry: capabilities,
88
142
  client,
@@ -95,11 +149,7 @@ export const brapiConnect = tool('brapi_connect', {
95
149
  * case `ctx.state` collapses every caller into the shared `default` tenant —
96
150
  * including the bearer token resolved by SGN/OAuth at connection time.
97
151
  */
98
- function isMultiTenantHttpDeployment() {
99
- const transport = (process.env.MCP_TRANSPORT_TYPE ?? 'stdio').toLowerCase();
100
- if (transport !== 'http')
101
- return false;
102
- const authMode = (process.env.MCP_AUTH_MODE ?? 'none').toLowerCase();
103
- return authMode !== 'jwt' && authMode !== 'oauth';
152
+ function isSharedTenantHttp() {
153
+ return config.mcpTransportType === 'http' && config.mcpAuthMode === 'none';
104
154
  }
105
155
  //# sourceMappingURL=brapi-connect.tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-connect.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,gBAAgB,GACpB,uUAAuU,CAAC;AAE1U,MAAM,uBAAuB,GAAG,2BAA2B,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE;IAChD,WAAW,EAAE,uBAAuB;QAClC,CAAC,CAAC,G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C,kBAAkB,IAAI,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,SAAS,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;IACrE,OAAO,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,OAAO,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"brapi-connect.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-connect.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAEL,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,gBAAgB,GACpB,giBAAgiB,CAAC;AAEniB,MAAM,uBAAuB,GAAG,2BAA2B,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE;IAChD,WAAW,EAAE,uBAAuB;QAClC,CAAC,CAAC,GAAG,gBAAgB,IAAI,uBAAuB,EAAE;QAClD,CAAC,CAA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E,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;CAChF,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAS,kBAAkB;IACzB,OAAO,MAAM,CAAC,gBAAgB,KAAK,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC;AAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-describe-filters.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-describe-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;qBAMnB,kBAAkB;;mBAEpB,4DAA4D;uBAEhE,wJAAwJ;cAiE9J,CAAC"}
1
+ {"version":3,"file":"brapi-describe-filters.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-describe-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;qBAMnB,kBAAkB;;mBAEpB,4DAA4D;uBAEhE,wJAAwJ;cAoE9J,CAAC"}
@@ -77,8 +77,13 @@ export const brapiDescribeFilters = tool('brapi_describe_filters', {
77
77
  lines.push('| Name | Type | Description | Example |');
78
78
  lines.push('|:-----|:-----|:------------|:--------|');
79
79
  for (const filter of result.filters) {
80
- const description = filter.description.replace(/\|/g, '\\|');
81
- lines.push(`| \`${filter.name}\` | \`${filter.type}\` | ${description} | \`${filter.example}\` |`);
80
+ // Backslashes first, so the `\` added before each pipe is not doubled.
81
+ const description = filter.description.replace(/\\/g, '\\\\').replace(/\|/g, '\\|');
82
+ // A backslash is already literal inside a code span, but a bare `|` still
83
+ // splits the row there: code-span cells escape pipes only.
84
+ const name = filter.name.replace(/\|/g, '\\|');
85
+ const example = filter.example.replace(/\|/g, '\\|');
86
+ lines.push(`| \`${name}\` | \`${filter.type}\` | ${description} | \`${example}\` |`);
82
87
  }
83
88
  lines.push('');
84
89
  lines.push(`_Available endpoints: ${result.availableEndpoints.map((e) => `\`${e}\``).join(', ')}._`);
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-describe-filters.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-describe-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE1F,MAAM,eAAe,GAAG,mBAAmB,EAAE,CAAC;AAE9C,MAAM,sBAAsB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IACvF,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;SACjF,QAAQ,CAAC,sBAAsB,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAC9E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;CAC7D,CAAC;KACD,QAAQ,CAAC,mEAAmE,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAA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J,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACR,yBAAyB,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACzF,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"brapi-describe-filters.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-describe-filters.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE1F,MAAM,eAAe,GAAG,mBAAmB,EAAE,CAAC;AAE9C,MAAM,sBAAsB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IACvF,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;SACjF,QAAQ,CAAC,sBAAsB,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAC9E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;CAC7D,CAAC;KACD,QAAQ,CAAC,mEAAmE,CAA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AA0E;YAC1E,2DAA2D;YAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACrD,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,UAAU,MAAM,CAAC,IAAI,QAAQ,WAAW,QAAQ,OAAO,MAAM,CAAC,CAAC;QACvF,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACR,yBAAyB,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACzF,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -67,6 +67,18 @@ export declare const brapiServerInfo: import("@cyanheads/mcp-ts-core").ToolDefin
67
67
  citation: z.ZodString;
68
68
  isDemo: z.ZodOptional<z.ZodBoolean>;
69
69
  }, z.core.$strip>>;
70
+ nextToolSuggestions: z.ZodArray<z.ZodObject<{
71
+ toolName: z.ZodEnum<{
72
+ brapi_find_germplasm: "brapi_find_germplasm";
73
+ brapi_find_locations: "brapi_find_locations";
74
+ brapi_find_studies: "brapi_find_studies";
75
+ brapi_find_variables: "brapi_find_variables";
76
+ }>;
77
+ reason: z.ZodString;
78
+ args: z.ZodObject<{
79
+ alias: z.ZodString;
80
+ }, z.core.$strip>;
81
+ }, z.core.$strip>>;
70
82
  notes: z.ZodArray<z.ZodString>;
71
83
  fetchedAt: z.ZodString;
72
84
  }, z.core.$strip>, readonly [{
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-server-info.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-server-info.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAMd,eAAe;;mBAEjB,6DAA6D;uBAEjE,qHAAqH;uBAC7G,SAAS;cAgCvB,CAAC"}
1
+ {"version":3,"file":"brapi-server-info.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-server-info.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAMd,eAAe;;mBAEjB,6DAA6D;uBAEjE,qHAAqH;uBAC7G,SAAS;cAgCvB,CAAC"}
@@ -13,7 +13,7 @@ import { getCapabilityRegistry } from '../../../services/capability-registry/ind
13
13
  import { requireRegisteredConnection } from '../shared/find-helpers.js';
14
14
  import { buildOrientationEnvelope, formatOrientationEnvelope, OrientationEnvelopeSchema, } from '../shared/orientation-envelope.js';
15
15
  export const brapiServerInfo = tool('brapi_server_info', {
16
- description: 'Return the full orientation envelope for a registered BrAPI connection — server identity, capabilities, content counts, and notes. Re-running refreshes the cached capability scan; pass an alias to read a non-default connection.',
16
+ description: 'Return the full orientation envelope for a registered BrAPI connection — server identity, capabilities, content counts, suggested finders, and notes. Re-running refreshes the cached capability scan; pass an alias to read a non-default connection.',
17
17
  annotations: { readOnlyHint: true, idempotentHint: true },
18
18
  errors: [
19
19
  {
@@ -1 +1 @@
1
- {"version":3,"file":"brapi-server-info.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-server-info.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,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE;IACvD,WAAW,EACT,qOAAqO;IACvO,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;IACzD,MAAM,EAAE;QACN;YACE,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,6DAA6D;YACnE,QAAQ,EACN,qHAAqH;YACvH,QAAQ,EAAE,SAAS;SACpB;KACO;IACV,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,KAAK,CAAC,kBAAkB,CAAC;aACzB,QAAQ,EAAE;aACV,QAAQ,CACP,uNAAuN,CACxN;QACH,YAAY,EAAE,CAAC;aACZ,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,mEAAmE,CAAC;KACjF,CAAC;IACF,MAAM,EAAE,yBAAyB;IAEjC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;QAEhC,MAAM,UAAU,GAAG,MAAM,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAEvE,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;CAChF,CAAC,CAAC"}
1
+ {"version":3,"file":"brapi-server-info.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/brapi-server-info.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,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE;IACvD,WAAW,EACT,wPAAwP;IAC1P,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;IACzD,MAAM,EAAE;QACN;YACE,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,6DAA6D;YACnE,QAAQ,EACN,qHAAqH;YACvH,QAAQ,EAAE,SAAS;SACpB;KACO;IACV,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,KAAK,CAAC,kBAAkB,CAAC;aACzB,QAAQ,EAAE;aACV,QAAQ,CACP,uNAAuN,CACxN;QACH,YAAY,EAAE,CAAC;aACZ,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,mEAAmE,CAAC;KACjF,CAAC;IACF,MAAM,EAAE,yBAAyB;IAEjC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;QAEhC,MAAM,UAAU,GAAG,MAAM,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAEvE,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;CAChF,CAAC,CAAC"}
@@ -114,6 +114,74 @@ export declare const readOnlyToolDefinitions: (import("@cyanheads/mcp-ts-core").
114
114
  readonly when: 'Upstream returned no study record for the requested DbId';
115
115
  readonly recovery: 'Verify the studyDbId on the target server, or run brapi_find_studies to discover valid IDs.';
116
116
  }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
117
+ alias: import("zod").ZodOptional<import("zod").ZodString>;
118
+ studies: import("zod").ZodArray<import("zod").ZodString>;
119
+ variables: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
120
+ germplasm: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
121
+ shape: import("zod").ZodDefault<import("zod").ZodEnum<{
122
+ long: "long";
123
+ wide: "wide";
124
+ }>>;
125
+ aggregate: import("zod").ZodDefault<import("zod").ZodEnum<{
126
+ all: "all";
127
+ first: "first";
128
+ mean: "mean";
129
+ median: "median";
130
+ }>>;
131
+ loadLimit: import("zod").ZodOptional<import("zod").ZodNumber>;
132
+ extraFilters: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
133
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
134
+ alias: import("zod").ZodString;
135
+ studies: import("zod").ZodArray<import("zod").ZodString>;
136
+ shape: import("zod").ZodEnum<{
137
+ long: "long";
138
+ wide: "wide";
139
+ }>;
140
+ aggregate: import("zod").ZodEnum<{
141
+ all: "all";
142
+ first: "first";
143
+ mean: "mean";
144
+ median: "median";
145
+ }>;
146
+ observationCount: import("zod").ZodNumber;
147
+ germplasmCount: import("zod").ZodNumber;
148
+ variableCount: import("zod").ZodNumber;
149
+ variableLegend: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
150
+ dataframe: import("zod").ZodOptional<import("zod").ZodObject<{
151
+ tableName: import("zod").ZodString;
152
+ rowCount: import("zod").ZodNumber;
153
+ columns: import("zod").ZodArray<import("zod").ZodString>;
154
+ columnLegend: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
155
+ createdAt: import("zod").ZodString;
156
+ expiresAt: import("zod").ZodString;
157
+ truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
158
+ maxRows: import("zod").ZodOptional<import("zod").ZodNumber>;
159
+ totalCount: import("zod").ZodOptional<import("zod").ZodNumber>;
160
+ }, import("zod/v4/core").$strip>>;
161
+ warnings: import("zod").ZodArray<import("zod").ZodString>;
162
+ }, import("zod/v4/core").$strip>, readonly [{
163
+ readonly reason: 'unknown_alias';
164
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
165
+ readonly when: 'No connection has been registered under the requested alias';
166
+ readonly recovery: 'Run brapi_connect with this alias (or omit `alias` to use the default connection) before calling brapi_build_phenotype_matrix.';
167
+ readonly thrownBy: 'service';
168
+ }, {
169
+ readonly reason: 'all_filters_dropped';
170
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
171
+ readonly when: 'The active dialect dropped every filter supplied — the call would silently widen to the unfiltered baseline';
172
+ readonly recovery: 'Drop unsupported filters or use studies / germplasm / variables to scope the query to supported filter paths on the active dialect.';
173
+ readonly thrownBy: 'service';
174
+ }, {
175
+ readonly reason: 'no_observation_path';
176
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
177
+ readonly when: 'Neither /observations nor /observationunits returned data for any requested study after probing both paths';
178
+ readonly recovery: 'Verify the studyDbIds exist and the BrAPI server exposes /observations or /observationunits. Use brapi_server_info to inspect the capability list.';
179
+ }], {
180
+ readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
181
+ readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
182
+ readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
183
+ readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
184
+ }> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
117
185
  alias: import("zod").ZodOptional<import("zod").ZodString>;
118
186
  germplasmDbIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
119
187
  variantSetDbId: import("zod").ZodString;
@@ -426,87 +494,65 @@ export declare const readOnlyToolDefinitions: (import("@cyanheads/mcp-ts-core").
426
494
  citation: import("zod").ZodString;
427
495
  isDemo: import("zod").ZodOptional<import("zod").ZodBoolean>;
428
496
  }, import("zod/v4/core").$strip>>;
497
+ nextToolSuggestions: import("zod").ZodArray<import("zod").ZodObject<{
498
+ toolName: import("zod").ZodEnum<{
499
+ brapi_find_germplasm: "brapi_find_germplasm";
500
+ brapi_find_locations: "brapi_find_locations";
501
+ brapi_find_studies: "brapi_find_studies";
502
+ brapi_find_variables: "brapi_find_variables";
503
+ }>;
504
+ reason: import("zod").ZodString;
505
+ args: import("zod").ZodObject<{
506
+ alias: import("zod").ZodString;
507
+ }, import("zod/v4/core").$strip>;
508
+ }, import("zod/v4/core").$strip>>;
429
509
  notes: import("zod").ZodArray<import("zod").ZodString>;
430
510
  fetchedAt: import("zod").ZodString;
431
511
  }, import("zod/v4/core").$strip>, readonly [{
512
+ readonly reason: 'auth_session_required';
513
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
514
+ readonly when: 'Caller-supplied credentials on an HTTP deployment without per-user auth, from a request that carries no MCP session';
515
+ readonly recovery: 'Connect from a client that keeps an MCP session (2025-era Streamable HTTP) or over stdio, use a deployment with MCP_AUTH_MODE=jwt or oauth, or omit `auth` to use server-configured credentials or none.';
516
+ readonly retryable: false;
517
+ }, {
518
+ readonly reason: 'auth_base_url_mismatch';
519
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
520
+ readonly when: 'The alias has server-configured credentials and the supplied baseUrl differs from the server configured for it';
521
+ readonly recovery: "Omit `baseUrl` to connect to the server configured for this alias, or register the other server under a different alias.";
522
+ readonly retryable: false;
523
+ readonly thrownBy: 'service';
524
+ }, {
525
+ readonly reason: 'alias_base_url_unset';
526
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ConfigurationError;
527
+ readonly when: 'The alias has server-configured credentials but no base URL of its own (no BRAPI_<ALIAS>_BASE_URL and no enabled built-in), so they pair with no server';
528
+ readonly recovery: 'Set BRAPI_<ALIAS>_BASE_URL on the server for this alias, or remove its credential variables, before retrying.';
529
+ readonly retryable: false;
530
+ readonly thrownBy: 'service';
531
+ }, {
432
532
  readonly reason: 'auth_token_exchange_failed';
433
533
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
434
534
  readonly when: 'SGN or OAuth token exchange against the BrAPI /token endpoint failed';
435
535
  readonly recovery: 'Verify the credentials and that the server exposes /token before retrying.';
536
+ readonly thrownBy: 'service';
436
537
  }, {
437
538
  readonly reason: 'auth_no_access_token';
438
539
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
439
540
  readonly when: 'Token endpoint responded but did not return an access_token';
440
541
  readonly recovery: 'Confirm the credentials are valid and the upstream IdP issues access tokens for this grant.';
441
- }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
442
- alias: import("zod").ZodOptional<import("zod").ZodString>;
443
- studies: import("zod").ZodArray<import("zod").ZodString>;
444
- variables: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
445
- germplasm: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
446
- shape: import("zod").ZodDefault<import("zod").ZodEnum<{
447
- long: "long";
448
- wide: "wide";
449
- }>>;
450
- aggregate: import("zod").ZodDefault<import("zod").ZodEnum<{
451
- all: "all";
452
- first: "first";
453
- mean: "mean";
454
- median: "median";
455
- }>>;
456
- loadLimit: import("zod").ZodOptional<import("zod").ZodNumber>;
457
- extraFilters: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
458
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
459
- alias: import("zod").ZodString;
460
- studies: import("zod").ZodArray<import("zod").ZodString>;
461
- shape: import("zod").ZodEnum<{
462
- long: "long";
463
- wide: "wide";
464
- }>;
465
- aggregate: import("zod").ZodEnum<{
466
- all: "all";
467
- first: "first";
468
- mean: "mean";
469
- median: "median";
470
- }>;
471
- observationCount: import("zod").ZodNumber;
472
- germplasmCount: import("zod").ZodNumber;
473
- variableCount: import("zod").ZodNumber;
474
- variableLegend: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
475
- dataframe: import("zod").ZodOptional<import("zod").ZodObject<{
476
- tableName: import("zod").ZodString;
477
- rowCount: import("zod").ZodNumber;
478
- columns: import("zod").ZodArray<import("zod").ZodString>;
479
- columnLegend: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
480
- createdAt: import("zod").ZodString;
481
- expiresAt: import("zod").ZodString;
482
- truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
483
- maxRows: import("zod").ZodOptional<import("zod").ZodNumber>;
484
- totalCount: import("zod").ZodOptional<import("zod").ZodNumber>;
485
- }, import("zod/v4/core").$strip>>;
486
- warnings: import("zod").ZodArray<import("zod").ZodString>;
487
- }, import("zod/v4/core").$strip>, readonly [{
488
- readonly reason: 'unknown_alias';
489
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
490
- readonly when: 'No connection has been registered under the requested alias';
491
- readonly recovery: 'Run brapi_connect with this alias (or omit `alias` to use the default connection) before calling brapi_build_phenotype_matrix.';
492
542
  readonly thrownBy: 'service';
493
543
  }, {
494
- readonly reason: 'all_filters_dropped';
495
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
496
- readonly when: 'The active dialect dropped every filter supplied — the call would silently widen to the unfiltered baseline';
497
- readonly recovery: 'Drop unsupported filters or use studies / germplasm / variables to scope the query to supported filter paths on the active dialect.';
544
+ readonly reason: 'upstream_unauthorized';
545
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Unauthorized;
546
+ readonly when: 'The server answered HTTP 401 on /serverinfo or /calls — it requires login for capability discovery';
547
+ readonly recovery: 'Retry brapi_connect with credentials in `auth` (sgn, bearer, api_key, or oauth2), or ask the operator to configure credentials for this alias server-side.';
498
548
  readonly thrownBy: 'service';
499
549
  }, {
500
- readonly reason: 'no_observation_path';
501
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
502
- readonly when: 'Neither /observations nor /observationunits returned data for any requested study after probing both paths';
503
- readonly recovery: 'Verify the studyDbIds exist and the BrAPI server exposes /observations or /observationunits. Use brapi_server_info to inspect the capability list.';
504
- }], {
505
- readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
506
- readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
507
- readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
508
- readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
509
- }> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
550
+ readonly reason: 'upstream_forbidden';
551
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
552
+ readonly when: 'The server answered HTTP 403 on /serverinfo or /calls — the request (anonymous or credentialed) lacks read access';
553
+ readonly recovery: 'Retry brapi_connect with credentials that have read access to this server, or ask the operator to configure such credentials for this alias server-side.';
554
+ readonly thrownBy: 'service';
555
+ }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
510
556
  alias: import("zod").ZodOptional<import("zod").ZodString>;
511
557
  forceRefresh: import("zod").ZodDefault<import("zod").ZodBoolean>;
512
558
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -565,6 +611,18 @@ export declare const readOnlyToolDefinitions: (import("@cyanheads/mcp-ts-core").
565
611
  citation: import("zod").ZodString;
566
612
  isDemo: import("zod").ZodOptional<import("zod").ZodBoolean>;
567
613
  }, import("zod/v4/core").$strip>>;
614
+ nextToolSuggestions: import("zod").ZodArray<import("zod").ZodObject<{
615
+ toolName: import("zod").ZodEnum<{
616
+ brapi_find_germplasm: "brapi_find_germplasm";
617
+ brapi_find_locations: "brapi_find_locations";
618
+ brapi_find_studies: "brapi_find_studies";
619
+ brapi_find_variables: "brapi_find_variables";
620
+ }>;
621
+ reason: import("zod").ZodString;
622
+ args: import("zod").ZodObject<{
623
+ alias: import("zod").ZodString;
624
+ }, import("zod/v4/core").$strip>;
625
+ }, import("zod/v4/core").$strip>>;
568
626
  notes: import("zod").ZodArray<import("zod").ZodString>;
569
627
  fetchedAt: import("zod").ZodString;
570
628
  }, import("zod/v4/core").$strip>, readonly [{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA4BH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;yDAAuB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAyB,CAAC;AAE5D,qEAAqE;AACrE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAA4B,CAAC"}
@@ -99,6 +99,12 @@ export interface ResolveFindRouteInput {
99
99
  * preserves the multi-value semantics the GET wire shape would have lost.
100
100
  */
101
101
  export declare function resolveFindRoute(input: ResolveFindRouteInput): FindRoute;
102
+ /**
103
+ * True when {@link resolveFindRoute} picks a route for `noun` on this server
104
+ * instead of throwing: GET `/{noun}` is advertised, or POST `/search/{noun}`
105
+ * is advertised and the active dialect does not mark it known-dead.
106
+ */
107
+ export declare function hasFindRoute(profile: CapabilityProfile, dialect: Pick<BrapiDialect, 'disabledSearchEndpoints'>, noun: string): boolean;
102
108
  /** Build request options with optional auth. */
103
109
  export declare function buildRequestOptions(connection: RegisteredServer, params?: BrapiRequestOptions['params'], overrides?: BrapiRequestOptions): BrapiRequestOptions;
104
110
  /**