mcpField
D
dt-js-runtime

dt-js-runtime

github.com/dynatraceDevelopment1691.8k installsUpdated today
Repository

About dt-js-runtime

A development reference skill for Dynatrace JavaScript Runtime, aimed at developers writing JavaScript or TypeScript functions in the AppEngine sandbox. It documents entry-point requirements, runtime constraints, available APIs, and execution with dtctl.

Key features

  1. 01Documents the async default-function contract
  2. 02References runtime limits and available modules
  3. 03Covers fetch, credential vault, and outbound allowlist
  4. 04Runs code files with dtctl
  5. 05Accepts JSON function input

Use cases

  1. 01Check a function's required entry-point shape
  2. 02Find supported Web APIs or Node.js modules
  3. 03Test a function with dtctl without deploying an app
  4. 04Pass JSON input to a runtime function

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dynatrace/dynatrace-for-ai --skill dt-js-runtime

After installing, type/dt-js-runtimein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
apis-and-modules.md
fetch.md
limits-and-restrictions.md
sdk.md
references/sdks/app-engine-registry/
appEngineRegistryAppsClient.md
appEngineRegistrySchemaManifestClient.md
README.md
types.md
references/sdks/app-environment/
functions.md
README.md
types.md
references/sdks/app-settings-v1/
appSettingsObjectsClient.md
README.md
types.md
references/sdks/app-settings-v2/
appSettingsObjectsClient.md
README.md
types.md
references/sdks/app-utils/
README.md
references/sdks/automation-utils/
constants.md
functions.md
README.md
types.md
references/sdks/automation/
actionExecutionsClient.md
actionsSampleResultClient.md
businessCalendarsClient.md
eventTriggersClient.md
executionsClient.md
README.md
schedulesClient.md
schedulingRulesClient.md

Details

From the project README

Dynatrace JavaScript Runtime

The Dynatrace JS runtime is a server-side AppEngine sandbox that executes JavaScript/TypeScript.

Function contract

Every entry point must export a default async function:

export default async function () {
  // ...
  return result;
}

ES module syntax required. TypeScript accepted (type annotations, interfaces, generics). No other export shape is supported.

References

Start here, then load only the file you need.

FileWhen to load
references/limits-and-restrictions.mdTimeout / memory / I/O quotas; what's forbidden (eval, WebSocket, sockets, filesystem)
references/apis-and-modules.mdWhich Web APIs and Node.js compat modules are available (fetch, crypto, streams, buffer, …)
references/fetch.mdCalling internal /platform/... APIs or external URLs, credential vault, outbound allowlist
references/sdk.mdAny @dynatrace-sdk/* package — the index routes you to the right per-SDK file

Running a function with dtctl

Use dtctl exec function to run JS runtime code without deploying an app.

# Run inline code
dtctl exec function --code 'export default async function() { return "hello" }'

# Run from file
dtctl exec function -f script.js

# Pass JSON input — the parsed object is the function's argument
dtctl exec function -f script.js --payload '{"key":"value"}'

The function may accept an optional parameter. --payload is parsed and passed as that argument directly — it is not wrapped in an event.payload field:

export default async function(payload) {
  // with --payload '{"key":"value"}', payload is {"key": "value"}
  return payload.key;
}

Load the dynatrace-control skill for authentication setup, context switching, and the full exec function reference.

Comments

Markdown supported