diff --git a/.github/skills/french-doc-translation/SKILL.md b/.github/skills/french-doc-translation/SKILL.md index f8543e4a63fd97..cc3846b88e45cf 100644 --- a/.github/skills/french-doc-translation/SKILL.md +++ b/.github/skills/french-doc-translation/SKILL.md @@ -1,6 +1,6 @@ --- name: french-doc-translation -description: 'Use when translating, editing, or reviewing French-language documentation in this repository.' +description: 'Use when translating, editing, or reviewing French-language documentation in this repository, including i18n .json translation files (sidebar labels, UI strings) and their UTF-8 encoding.' --- # French Documentation Translation @@ -13,3 +13,28 @@ When translating or editing French documentation in this repository: - Preserve code, identifiers, UI labels, links, and other technical literals as required by the source; do not alter quotes that are part of code or literal syntax. Before completing the work, check the edited French documentation for `«` and `»` and replace them in prose with straight double quotation marks. Also check that note labels use "Note"/"Notes", not "Remarque"/"Remarques". + +## Encoding of translation files (`i18n/**/*.json` and `.md`) + +Translation files (for example `i18n/fr/docusaurus-plugin-content-docs/current.json`) must stay UTF-8 without BOM. Accented or non-Latin characters have been corrupted into literal `?` (for example `"G?n?rateur d'applications"`, `"Cl?s XML"`, or Japanese `"????"`) when the text passed through the Windows PowerShell console or a pipe that does not use UTF-8. + +- Prefer the `edit`/`create` tools to write translated strings; do not pass accented text through PowerShell (`Set-Content`, `Out-File`, `>`, `echo`) or through a script piped from PowerShell. +- If a script is required, read and write bytes as UTF-8 explicitly (`open(f, encoding='utf-8')` or `'rb'`/`'wb'`) and write non-ASCII characters in the script source as `\u` escapes (for example `G\u00e9n\u00e9rateur`). +- Reuse the terminology already used in the translated pages (for example the `title`/`sidebar_label` of the corresponding `.md` file) for sidebar labels in `current.json`. + +After editing, verify that the file still parses as JSON and that no `"message"` value contains a `?` inside a word or a `??` sequence, for example: + +```powershell +@' +import glob, json, re +bad = [] +for f in glob.glob('i18n/**/*.json', recursive=True): + text = open(f, encoding='utf-8').read() + json.loads(text) + bad += [(f, i + 1) for i, l in enumerate(text.splitlines()) + if '"message"' in l and re.search(r'\?\?|[^\W\d_]\?[^\W\d_]', l)] +print(bad) +'@ | python - +``` + +The output must be `[]`. This check applies to all languages (`fr`, `es`, `ja`, `pt`), not only French. diff --git a/.github/skills/new-command-documentation/SKILL.md b/.github/skills/new-command-documentation/SKILL.md new file mode 100644 index 00000000000000..ea56cf3525fa3a --- /dev/null +++ b/.github/skills/new-command-documentation/SKILL.md @@ -0,0 +1,23 @@ +--- +name: new-command-documentation +description: 'Use when adding or documenting a new 4D language command in this documentation repository. Covers the command page, release notes, theme listing, and alphabetical command index.' +--- + +# New Command Documentation + +Use this workflow whenever a new 4D command is added to the documentation. + +## Procedure + +1. Confirm the command name, syntax, behavior, result structure, examples, command number, thread-safety, theme, and target 4D release from the feature requirements. Do not guess missing API details or the release version. +2. Create or update the command page in the appropriate source directory. Follow the structure and reference markers used by nearby command pages, including front matter, syntax and parameter references, history, description, result properties, examples, see-also links, and command properties when applicable. Include at least one complete, copyable example grounded in the feature requirements. +3. Add a concise announcement to the `Highlights` section for the target release in `docs/Notes/updates.md`, linking to the command page. Do not duplicate an announcement that is already present. +4. Add the command to the appropriate page in `docs/commands/theme/`, in alphabetical order. Follow the existing command syntax include and relative-link format, and add the release marker when used by the page's conventions. +5. Add the command to `docs/commands/command-index.md` in alphabetical order, linking to its command page and ending the line with `**new 4D **`. + +## Validation + +- Verify the command page and all links resolve to existing files or valid documentation routes. +- Check that the theme page and command index each contain one correctly sorted entry. +- Confirm the release note appears once under the correct release and links to the command page. +- Run the narrowest available documentation validation and review the final diff without overwriting unrelated or pre-existing changes. \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml index 9311ac13370e70..13ded952d94c61 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -9,6 +9,7 @@ files: - /docs/WritePro/*-legacy/*.* - /docs/language-legacy/**/*.* - /docs/BuildApplication/*.* + - /docs/embedding-studio/**/* translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name% - source: /i18n/en/docusaurus-plugin-content-docs/*.json ignore: @@ -24,6 +25,7 @@ files: - /versioned_docs/**/language-legacy/**/*.* - /versioned_docs/version-19/ - /versioned_docs/**/BuildApplication/*.* + - /versioned_docs/**/embedding-studio/**/* translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name% - source: /i18n/en/docusaurus-theme-classic/*.json translation: /i18n/%two_letters_code%/docusaurus-theme-classic/%original_file_name% diff --git a/docs/API/DataStoreClass.md b/docs/API/DataStoreClass.md index a80d5951c8e24b..b750ffa2e3d3b7 100644 --- a/docs/API/DataStoreClass.md +++ b/docs/API/DataStoreClass.md @@ -17,19 +17,14 @@ A [Datastore](ORDA/dsMapping.md#datastore) is the interface object provided by O |[](#dataclassname)
| |[](#encryptionstatus)
| |[](#flushandlock)
| -|[](#generatefinegrainedtoken)
| |[](#getallremotecontexts)
| |[](#getglobalstamp)
| |[](#getinfo)
| |[](#getremotecontextinfo)
| |[](#getrequestlog)
| -|[](#listfinegrainedtokens)
| -|[](#listoauthgrants)
| |[](#locked)
| |[](#makeselectionsalterable)
| |[](#providedatakey)
| -|[](#revokefinegrainedtoken)
| -|[](#revokeoauthgrant)
| |[](#setadminprotection)
| |[](#setglobalstamp)
| |[](#setremotecontextinfo)
| @@ -304,81 +299,6 @@ ds.unlock() //Our copy is over, we can now unlock the datastore [.locked()](#locked)
[.unlock()](#unlock) - -## .generateFineGrainedToken() - -
History - -|Release|Changes| -|---|---| -|21 R6|Added| - -
- -**.generateFineGrainedToken**( *privilege* : Text ; *name* : Text {; *expiry* : Date {; *info* : Object}} ) : Object
**.generateFineGrainedToken**( *privileges* : Collection ; *name* : Text {; *expiry* : Date {; *info* : Object}} ) : Object
**.generateFineGrainedToken**( *settings* : Object ; *name* : Text {; *expiry* : Date {; *info* : Object}} ) : Object - - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|privilege|Text|→|Privilege name, or comma-separated privilege names| -|privileges|Collection|→|Collection of privilege names| -|settings|Object|→|Object with a "privileges" and/or "roles" property| -|name|Text|→|Name of the token| -|expiry|Date|→|Expiration date of the token| -|info|Object|→|Information stored with the token and passed to `ds.mcpAuthenticated()` in `$info.info`| -|Result|Object|←|`{id; token}`| -
- - -#### Description - -The `.generateFineGrainedToken()` function generates a Fine-Grained Token that gives access to the MCP server with the privileges you pass. For more information, see [Fine-Grained Tokens](../WebServer/mcp-server.md#fine-grained-tokens). - -You pass the privileges and/or roles of the token in the same forms as for [`Session.setPrivileges()`](SessionClass.md#setprivileges): - -- In the *privilege* parameter, pass a string containing a privilege name (or several comma-separated privilege names). -- In the *privileges* parameter, pass a collection of strings containing privilege names. -- In the *settings* parameter, pass an object with a `privileges` and/or a `roles` property (string or collection of strings). - -Unlike `Session.setPrivileges()`, a name that is not declared in the [`roles.json`](../ORDA/privileges.md#rolesjson-file) file raises an error. - -In *name*, pass a name that identifies the token, for example the user and the client that will use it. It is the user name of the MCP sessions opened with the token. - -In *expiry*, pass the expiration date of the token. It must be later than the current date and at most 366 days ahead. If *expiry* is omitted, an error is raised. - -In *info*, you can pass an object that 4D stores with the token as is, and passes to the [`ds.mcpAuthenticated()`](../ORDA/ordaClasses.md#function-mcpauthenticated) function, in the `info` property of its *$info* parameter, when an MCP session is opened with the token. Since it cannot be modified later, store stable identifiers (such as a user ID) and read the current values in `ds.mcpAuthenticated()`. Build *info* from the authenticated session, never from values sent by the client. - -The function can only be called in a web context, i.e. from code executed for a web or REST request (for example an exposed function called after the user was authenticated). Every privilege of the token must be held by the current session ([`Session.getPrivileges()`](SessionClass.md#getprivileges), roles included, promoted privileges excluded). Otherwise, an error is raised. - -If an error is raised, no token is created. - -**Returned object** - -|Property|Type|Description| -|---|---|---| -|id|Text|Identifier of the token. It is not secret: use it to [revoke](#revokefinegrainedtoken) the token| -|token|Text|The token, starting with "4dfgt_". It is returned only once: 4D only stores its hash, in the `fgt.json` file of the data folder| - -#### Example - -In an exposed function of the DataStore class, called by an authenticated user, you generate a token valid for 3 months: - -```4d -exposed Function getMCPToken() : Text - var $expiry:=Add to date(Current date; 0; 3; 0) - var $result:=ds.generateFineGrainedToken({roles: "salesperson"}; "Claude Desktop - "+Session.userName; $expiry; {userName: Session.userName}) - return $result.token // "4dfgt_..." -``` - -#### See also - -[.listFineGrainedTokens()](#listfinegrainedtokens)
[.revokeFineGrainedToken()](#revokefinegrainedtoken) - - - ## .getAllRemoteContexts() @@ -713,113 +633,6 @@ By default, the Data Explorer access is granted for `webAdmin` sessions, but it - -## .listFineGrainedTokens() - -
History - -|Release|Changes| -|---|---| -|21 R6|Added| - -
- -**.listFineGrainedTokens**() : Collection - - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|Result|Collection|←|Collection of token description objects| -
- - -#### Description - -The `.listFineGrainedTokens()` function returns the description of the Fine-Grained Tokens generated for the MCP server (see [`.generateFineGrainedToken()`](#generatefinegrainedtoken)). - -When the function is called in a web context (code executed for a web or REST request), the collection only contains the tokens whose privileges are all held by the current session. Elsewhere (for example in a method or a stored procedure), it contains all the tokens. - -Each object of the returned collection contains the following properties. The token itself and its hash are never returned. - -|Property|Type|Description| -|---|---|---| -|id|Text|Identifier of the token| -|name|Text|Name of the token| -|privileges|Text, Collection or Object|Privileges and roles of the token, as passed at generation| -|expiry|Text|Expiration date of the token| -|info|Object|Information stored with the token| -|createdAt|Text|Date and time of the token generation| - -#### Example - -You revoke all the tokens generated for a user: - -```4d -var $tokens:=ds.listFineGrainedTokens().query("info.userName = :1"; "jsmith") -var $token : Object -For each ($token; $tokens) - ds.revokeFineGrainedToken($token.id) -End for each -``` - - - - - -## .listOAuthGrants() - -
History - -|Release|Changes| -|---|---| -|21 R6|Added| - -
- -**.listOAuthGrants**() : Collection - - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|Result|Collection|←|Collection of grant description objects| -
- - -#### Description - -The `.listOAuthGrants()` function returns the description of the grants given to users through the OAuth mode of the MCP server. A grant is created each time a user logs in from an MCP client (see [OAuth 2.1 mode](../WebServer/mcp-server.md#oauth-21-mode)). - -When the function is called in a web context (code executed for a web or REST request), the collection only contains the grants whose privileges are all held by the current session. Elsewhere, it contains all the grants. - -Each object of the returned collection contains the following properties: - -|Property|Type|Description| -|---|---|---| -|id|Text|Identifier of the grant| -|userName|Text|User name of the grant (`userName` returned by [`ds.mcpGrant()`](../ORDA/ordaClasses.md#function-mcpgrant), or the login name)| -|clientId|Text|Identifier of the MCP client| -|clientName|Text|Name of the MCP client| -|privileges|Text, Collection or Object|Privileges and roles returned by `ds.mcpGrant()`| -|createdAt|Text|Date and time of the login| -|lastUsedAt|Text|Date and time of the last use of the grant| -|expiresAt|Text|Expiration date and time of the grant| - -#### Example - -You list the MCP clients in which a user is logged in: - -```4d -var $clients:=ds.listOAuthGrants().query("userName = :1"; "jsmith").extract("clientName") -``` - - - ## .locked() @@ -976,113 +789,6 @@ If no *curPassphrase* or *curDataKey* is given, `.provideDataKey()` returns **nu - -## .revokeFineGrainedToken() - -
History - -|Release|Changes| -|---|---| -|21 R6|Added| - -
- -**.revokeFineGrainedToken**( *id* : Text ) : Boolean
**.revokeFineGrainedToken**( *tokenObj* : Object ) : Boolean - - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|id|Text|→|Identifier of the token to revoke| -|tokenObj|Object|→|Object with a `token` property containing the token to revoke| -|Result|Boolean|←|True if the token was revoked| -
- - -#### Description - -The `.revokeFineGrainedToken()` function revokes a Fine-Grained Token of the MCP server. - -You designate the token: - -- in the *id* parameter, with its identifier (returned by [`.generateFineGrainedToken()`](#generatefinegrainedtoken) and [`.listFineGrainedTokens()`](#listfinegrainedtokens)), -- or in the *tokenObj* parameter, with an object whose `token` property contains the token itself (`"4dfgt_..."`), for example to let the holder of a token revoke it. - -The function returns **True** if the token was revoked, **False** otherwise (for example if the token does not exist or was already revoked). - -The token stops working at the next request, and the MCP sessions opened with it are closed. [Binary URLs](../WebServer/mcp-server.md#binary-attributes) already returned to the client remain valid until they expire (10 minutes at most). - -When the function is called in a web context (code executed for a web or REST request), it can only revoke a token whose privileges are all held by the current session. - -#### Example - -You revoke a token by its id: - -```4d -var $tokens:=ds.listFineGrainedTokens().query("name = :1"; "Claude Desktop - jsmith") -If ($tokens.length>0) - ds.revokeFineGrainedToken($tokens[0].id) -End if -``` - -#### See also - -[.generateFineGrainedToken()](#generatefinegrainedtoken)
[.listFineGrainedTokens()](#listfinegrainedtokens) - - - - -## .revokeOAuthGrant() - -
History - -|Release|Changes| -|---|---| -|21 R6|Added| - -
- -**.revokeOAuthGrant**( *id* : Text ) : Boolean - - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|id|Text|→|Identifier of the grant to revoke| -|Result|Boolean|←|True if the grant was revoked| -
- - -#### Description - -The `.revokeOAuthGrant()` function revokes a grant given to a user through the OAuth mode of the MCP server (see [`.listOAuthGrants()`](#listoauthgrants)). - -The function returns **True** if the grant was revoked, **False** otherwise (for example if the grant does not exist or was already revoked). - -The access tokens of the grant get an HTTP 401 status from the next request, its refresh token is refused, and its MCP sessions are closed. The user must log in again from the MCP client. - -When the function is called in a web context (code executed for a web or REST request), it can only revoke a grant whose privileges are all held by the current session. - -#### Example - -When you deactivate a user of your application, you revoke their OAuth grants: - -```4d -var $grant : Object -For each ($grant; ds.listOAuthGrants().query("userName = :1"; "jsmith")) - ds.revokeOAuthGrant($grant.id) -End for each -``` - -#### See also - -[.listOAuthGrants()](#listoauthgrants)
[.revokeFineGrainedToken()](#revokefinegrainedtoken) - - ## .setAdminProtection() diff --git a/docs/API/MCPContextClass.md b/docs/API/MCPContextClass.md deleted file mode 100644 index 79aa4b20f8fd97..00000000000000 --- a/docs/API/MCPContextClass.md +++ /dev/null @@ -1,313 +0,0 @@ ---- -id: MCPContextClass -title: MCPContext ---- - -The `MCPContext` class provides information about the current call of a tool of the [MCP server](../WebServer/mcp-server.md), and lets the tool ask the user for a confirmation or for values before running an action (see [Asking the user for confirmation](../WebServer/mcp-server.md#asking-the-user-for-confirmation)). - -
History - -|Release|Changes| -|---|---| -|21 R6|Class added| - -
- -### MCPContext Object - -`MCPContext` objects are returned by the [`MCP`](../commands/mcp) command. - -The object is attached to the process while a [custom tool](../WebServer/mcp-server.md#custom-tools) function runs, and it is available in the methods and functions called by this function. Anywhere else (for example in a REST request or in a method run from the 4D environment), the object is inert: its functions do nothing and its properties are empty. - -### Summary - -|| -|---| -|[](#bound)
| -|[](#canelicit)
| -|[](#clientinfo)
| -|[](#error)
| -|[](#hasinput)
| -|[](#input)
| -|[](#requireinput)
| -|[](#toolname)
| - - - - -## .bound - -**.bound** : any - -#### Description - -The `.bound` property contains the *bind* value passed to `.requireInput()` when the input was asked, as verified by 4D. - -The value comes back signed with the user's answers, so the function can compare it with the current value and detect a change that occurred while the user was answering (for example, a modified entity). It is empty when the call does not carry verified answers. - -Bind what the user was shown. For example, a tool acting on several entities binds their keys, or a digest of their keys, rather than their number: a count only detects a change of size, not other entities taking the place of the ones the user confirmed. - -The *bind* value is signed, not encrypted: the client can read it. - -This property is **read-only**. - -#### Example - -You check that the entity was not modified while the user was confirming its deletion: - -```4d -If (MCP.bound#This.getStamp()) - MCP.error("The record was modified, please try again") - return -End if -``` - - - - - -## .canElicit - -**.canElicit** : Boolean - -#### Description - -The `.canElicit` property contains **True** if the MCP client can display input forms (it declared the `elicitation` capability in the request), and **False** otherwise or outside an MCP tool call. - -When `.canElicit` is **False**, [`.requireInput()`](#requireinput) asks nothing and the call returns the error "This action requires a confirmation your client cannot display". - -This property is **read-only**. - -#### Example - -You return a clear message when the client cannot display the confirmation: - -```4d -If (Not(MCP.canElicit)) - MCP.error("Please confirm this action from the application") - return -End if -``` - - - - - -## .clientInfo - -**.clientInfo** : Object - -#### Description - -The `.clientInfo` property contains information about the MCP client that sent the request, as provided in the metadata (`_meta`) of the request, for example its name and version. It is *Null* outside an MCP tool call. - -This property is **read-only**. - -#### Example - -You log the client that called the tool: - -```4d -var $client:=MCP.clientInfo -If ($client#Null) - LOG EVENT(Into 4D debug message; "MCP call from "+String($client.name)) -End if -``` - - - - - -## .error() - -**.error**( { *message* : Text } ) - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|message|Text|→|Error message returned to the client| -
- - -#### Description - -The `.error()` function makes the current tool call return an error result with *message*. The result has `isError: true`, and the value returned by the function is ignored. If *message* is omitted, the error message is empty. - -`.error()` does not stop the execution of the function: call `return` after it if needed. - -An error raised while the function runs (for example with [`throw`](../commands/throw)) also ends the call with an error result (`isError: true`) containing the error message. - -Outside an MCP tool call, `.error()` does nothing. - -#### Example - -You refuse an amount that is too high: - -```4d -exposed mcp Function refund($amount : Real) : Text - If ($amount>1000) - MCP.error("Refunds over 1000 must be done by an accountant") - return - End if - // ... -``` - - - - - -## .hasInput() - -**.hasInput**( { *name* : Text } ) : Boolean - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|name|Text|→|Name of a field requested with `.requireInput()`| -|Result|Boolean|←|True if the user answered this field (or any field if *name* is omitted)| -
- - -#### Description - -The `.hasInput()` function returns **True** if the current call contains a verified answer of the user for the *name* field. - -If *name* is omitted or empty, `.hasInput()` returns **True** if the current call contains a verified answer of the user for at least one field. - -The answer is verified when the client calls the tool again with the answers and a valid `requestState`: signed by 4D for the same token, tool, arguments, and fields, less than 10 minutes ago, and since the MCP server was last enabled. Otherwise, `.hasInput()` returns **False**. - -Outside an MCP tool call, `.hasInput()` returns **False**. - -#### Example - -You ask for a confirmation only if the user has not answered yet: - -```4d -If (Not(MCP.hasInput("confirm"))) - MCP.requireInput({confirm: {type: "boolean"; prompt: "Send the invoice to the customer?"}}) - return -End if -``` - - - - - -## .input - -**.input** : Object - -#### Description - -The `.input` property contains the verified answers of the user, one property per field requested with `.requireInput()`. Only answers whose type matches the type of the requested field are kept. - -It does not contain any answer when the call does not carry verified answers, or outside an MCP tool call. - -This property is **read-only**. - -#### Example - -You use the comment entered by the user: - -```4d -If (MCP.hasInput("comment")) - This.closingComment:=MCP.input.comment -End if -``` - - - - - -## .requireInput() - -**.requireInput**( *fields* : Object {; *bind* : any} ) : Object - - -
- -|Parameter|Type||Description| -|---|---|---|---| -|fields|Object|→|Message and fields to display to the user| -|bind|any|→|Value signed with the answers, returned in `.bound`| -|Result|Object|←|*Null* when the input is requested| -
- - -#### Description - -The `.requireInput()` function asks the user, through the MCP client, to fill in a form before the tool continues. - -In *fields*, pass an object with one property per field to display. The property name is the field name, and its value is an object with: - -- a `type` property: the JSON Schema type of the field, `"string"`, `"number"`, `"integer"`, or `"boolean"`. For a choice, use a `"string"` field with an `enum` collection of the possible values, as in JSON Schema (for example `{type: "string"; enum: ["Yes"; "No"]; prompt: "Ship now?"}`), -- a `prompt` property (Text): the text displayed to the user for this field, for example the question to confirm. - -A field is required unless its object contains `required: False`. - -Any other `type` (for example `"text"` or `"enum"`) raises an error naming the field and the expected types, and the tool call ends with an error result (`isError: true`). - -When the tool function returns, 4D answers the call with `resultType: "input_required"`, the form, and a `requestState` signed by 4D. The client displays the form, then calls the tool again with the answers. The function then runs again **from the top**: [`.hasInput()`](#hasinput) returns **True** for the answered fields and [`.input`](#input) contains the answers. If the answers are already there and *bind* has the same value as when the input was asked, `.requireInput()` does not ask again. - -In *bind*, you can pass a value to bind to the answers, such as the stamp of an entity: it is signed with the answers and returned in [`.bound`](#bound) when the client calls the tool again, so that you can check that nothing changed in the meantime. If *bind* changed, the input is asked again. - -If the client cannot display forms (see [`.canElicit`](#canelicit)), `.requireInput()` asks nothing and the call returns the error "This action requires a confirmation your client cannot display". - -Outside an MCP tool call, `.requireInput()` asks nothing and returns *Null*. - -:::caution - -Do not ask for secrets such as passwords with `.requireInput()`: the answers go through the AI client. - -::: - -#### Example - -You ask the user to confirm the closing of a ticket and to enter an optional comment: - -```4d -// cs.TicketEntity class -Class extends Entity - -exposed mcp Function close() : Text - If (Not(MCP.hasInput("confirm"))) - MCP.requireInput({confirm: {type: "boolean"; prompt: "Close ticket "+String(This.ID)+"?"}; comment: {type: "string"; prompt: "Comment"; required: False}}; This.getStamp()) - return - End if - If (MCP.input.confirm) - This.status:="closed" - This.comment:=String(MCP.input.comment) - This.save() - End if - return This.status -``` - - - - - -## .toolName - -**.toolName** : Text - -#### Description - -The `.toolName` property contains the name of the MCP tool being called, for example `"OrderManager-getYearTotal"`. It is an empty string outside an MCP tool call. - -This property is **read-only**. - -#### Example - -You run a method only when it is called by an MCP tool: - -```4d -If (MCP.toolName#"") - // called from an MCP tool -End if -``` - - diff --git a/docs/API/SessionClass.md b/docs/API/SessionClass.md index a6ebf584171a94..df46abd9b6e3ea 100644 --- a/docs/API/SessionClass.md +++ b/docs/API/SessionClass.md @@ -23,7 +23,7 @@ Session objects are returned by the [`Session`](../commands/session) command. Th The following types of sessions are supported by this class: -- [**Web user sessions**](../WebServer/sessions.md): Web user sessions are available when [scalable sessions are enabled in your project](../WebServer/sessions.md#enabling-web-sessions). They are used for Web connections (including REST access and [MCP server](../WebServer/mcp-server.md) access), and are controlled by assigned [privileges](../ORDA/privileges.md). +- [**Web user sessions**](../WebServer/sessions.md): Web user sessions are available when [scalable sessions are enabled in your project](../WebServer/sessions.md#enabling-web-sessions). They are used for Web connections (including REST access), and are controlled by assigned [privileges](../ORDA/privileges.md). - [**Remote user sessions**](../Desktop/sessions.md#remote-user-sessions): In client/server applications, remote users have their own sessions, managed from the client and from the server. - [**Stored procedures sessions**](../Desktop/sessions.md#stored-procedure-sessions): Virtual user session for all stored procedures executed on the server. - [**Standalone sessions**](../Desktop/sessions.md#standalone-sessions): Local session object returned in single-user application (useful in development and test phases of client/server applications). @@ -535,7 +535,6 @@ End if |Release|Changes| |---|---| -|21 R6|New "mcp" session type| |21 R4|New *unreachableSince* property| |20 R5|Added| @@ -557,7 +556,7 @@ The `.info` object contains the following properties: |Property|Type|Description| |---|---|---| -|type|Text|Session type: "remote", "storedProcedure", "standalone", "rest", "web", "mcp" (session of the [MCP server](../WebServer/mcp-server.md#mcp-sessions))| +|type|Text|Session type: "remote", "storedProcedure", "standalone", "rest", "web"| |userName|Text|4D user name (same value as [`.userName`](#username))| |machineName|Text|| |systemUserName|Text|