From 20e7c8d5776574eb6712a18224832b8c3786a878 Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Thu, 15 Jan 2026 22:53:54 -0500 Subject: [PATCH 1/3] Updating prism-cli version openapi spec file fails to download with the previous version --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae..c3e3d5b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.16.1 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.16.1 -- prism mock "$URL" fi From 5f3185d587dc80a1f8c8936eb88ab56f306f3ddf Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Thu, 15 Jan 2026 22:54:51 -0500 Subject: [PATCH 2/3] Add CONTRIBUTING.md with basic build instructions --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b6f2407 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +## Modifying/Adding code + +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `arcade-java/lib/` and `arcade-java-examples/` directories. + +## Adding and running examples + +TODO + +## Building the repository from source + +If you’d like to use the repository from source, you can build and install it from git: + +```sh +git clone git@github.com/ArcadeAI/arcade-java.git +SKIP_MOCK_TESTS=true ./gradlew build publishToMavenLocal # This will skip the integration tests, see below on info on how to run them. +``` +## Running tests + +Most tests require you to [run a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. + +```sh +# you will need npm installed +./scripts/mock --daemon +``` + +The mock serer will run in the background allowing you to run tests from the command line `./gradlew test` or from your IDE. + +To stop the mock server run: +```shell +pkill -f prism +``` + +## Linting and formatting + +This repository uses [Spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle) to lint and format the code in the repository. + +To lint: + +```sh +$ ./scripts/lint +``` + +To format and fix all issues automatically: + +```sh +$ ./scripts/format +``` From 0e26b02ed5e3bd10d9b5d24b7537dde99455a778 Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Thu, 15 Jan 2026 22:55:15 -0500 Subject: [PATCH 3/3] Add simple tool call example --- .../arcade/example/simple/PlaySpotify.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 arcade-java-example/src/main/java/dev/arcade/example/simple/PlaySpotify.java diff --git a/arcade-java-example/src/main/java/dev/arcade/example/simple/PlaySpotify.java b/arcade-java-example/src/main/java/dev/arcade/example/simple/PlaySpotify.java new file mode 100644 index 0000000..3c569c7 --- /dev/null +++ b/arcade-java-example/src/main/java/dev/arcade/example/simple/PlaySpotify.java @@ -0,0 +1,41 @@ +package dev.arcade.example.simple; + +import dev.arcade.client.ArcadeClient; +import dev.arcade.client.okhttp.ArcadeOkHttpClient; +import dev.arcade.models.ExecuteToolRequest; +import dev.arcade.models.ExecuteToolResponse; +import dev.arcade.models.ToolExecuteParams; + +/** + * Example of calling a tool using the Arcade Java SDK. + */ +public class PlaySpotify { + + /** + * Simple main method example. + * @param args Not used. + */ + public static void main(String[] args) { + + // Configures using the `ARCADE_API_KEY` environment variable + ArcadeClient client = ArcadeOkHttpClient.fromEnv(); + + String userId = System.getenv("ARCADE_USER_ID"); // the Spotify tool require a userId + if (userId == null) { + throw new IllegalArgumentException("Missing ARCADE_USER_ID environment variable"); + } + + ToolExecuteParams params = ToolExecuteParams.builder() + .executeToolRequest(ExecuteToolRequest.builder() + .toolName("Spotify.ResumePlayback@1.0.2") + .userId(userId) + .build()) + .build(); + ExecuteToolResponse executeToolResponse = client.tools().execute(params); + executeToolResponse + .output() + .ifPresentOrElse( + output -> System.out.println("Tool output: " + output._value()), + () -> System.out.println("No output for this tool")); + } +}