@xano/xanoscript-language-server 12.22.0 → 12.22.1

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.
@@ -444,7 +444,7 @@ api.call "account/{account_id}" verb=POST {
444
444
  } as $account_update_response
445
445
  ```
446
446
 
447
- Calls an internal Xano API endpoint from within a `workflow_test` or `test` clause. This allows you to invoke internal APIs as part of your end-to-end workflow tests or unit tests within queries, functions, and tasks.
447
+ Calls an internal Xano API endpoint from within a `workflow_test`, `tool`, `prompt`, `resource` or `test` clause. This allows you to invoke internal APIs as part of your end-to-end workflow tests, from MCP tools, prompts and resources, or in unit tests within queries, functions, and tasks.
448
448
 
449
449
  To call the endpoint as a logged-in user, pass a token with `auth = {token: "...", ignore_expiration: true}` (a literal token) or an `Authorization` header (`headers = ["Authorization: Bearer " ~ $token]`).
450
450
 
@@ -482,7 +482,7 @@ tool.call "my_tool" {
482
482
  } as $tool_response
483
483
  ```
484
484
 
485
- Calls an internal Xano AI tool, it allows you to invoke internal tools within your end-to-end workflows tests.
485
+ Calls an internal Xano AI tool, it allows you to invoke internal tools within your end-to-end workflows tests, and from other tools, prompts and resources.
486
486
 
487
487
  - `tool.call` takes the name of the tool as an argument.
488
488
  - `input`: The input parameters for the tool.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/xanoscript-language-server",
3
- "version": "12.22.0",
3
+ "version": "12.22.1",
4
4
  "description": "Language Server Protocol implementation for XanoScript, the language of Xano backends",
5
5
  "keywords": [
6
6
  "xano",
@@ -24,6 +24,8 @@ export function apiCallFn($) {
24
24
  const validContexts = [
25
25
  "workflowTestDeclaration",
26
26
  "toolDeclaration",
27
+ "promptDeclaration",
28
+ "resourceDeclaration",
27
29
  "testClause",
28
30
  ];
29
31
  const isInValidContext = validContexts.some((context) =>
@@ -33,7 +35,7 @@ export function apiCallFn($) {
33
35
  if (!isInValidContext) {
34
36
  $.addInvalidValueError(
35
37
  fnToken,
36
- "api.call can only be used within workflow_test, tool, or test contexts",
38
+ "api.call can only be used within workflow_test, tool, prompt, resource, or test contexts",
37
39
  );
38
40
  }
39
41
 
@@ -271,7 +271,12 @@ function mcpPrimitiveDeclaration($, kind) {
271
271
  GATE: () => !hasStack,
272
272
  ALT: () => {
273
273
  hasStack = true;
274
- $.SUBRULE($.stackClause);
274
+ // Like a tool's: the backend's prompt/resource runner loads the
275
+ // workspace's tools, addons and middleware, so the call
276
+ // statements resolve here.
277
+ $.SUBRULE($.stackClause, {
278
+ ARGS: [{ allowCallStatements: true }],
279
+ });
275
280
  },
276
281
  },
277
282
  {