roboraw-mcp 1.0.1 → 1.1.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.
- package/dist/index.js +2 -2
- package/dist/tools/games.d.ts +1 -0
- package/dist/tools/games.js +8 -1
- package/dist/tools/surveys.d.ts +6 -0
- package/dist/tools/surveys.js +26 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ async function onboard() {
|
|
|
56
56
|
console.log("");
|
|
57
57
|
process.exit(1);
|
|
58
58
|
}
|
|
59
|
-
const apiUrl =
|
|
59
|
+
const apiUrl = "https://api.roboraw.com";
|
|
60
60
|
// Verify the token works
|
|
61
61
|
console.log("");
|
|
62
62
|
console.log(" \x1b[90mVerifying token...\x1b[0m");
|
|
@@ -129,7 +129,7 @@ function main() {
|
|
|
129
129
|
const client = new RoboRawClient(apiUrl, agentToken);
|
|
130
130
|
const server = new McpServer({
|
|
131
131
|
name: "roboraw",
|
|
132
|
-
version: "1.0.
|
|
132
|
+
version: "1.0.2",
|
|
133
133
|
});
|
|
134
134
|
// Register all tools
|
|
135
135
|
registerHeartbeat(server, client);
|
package/dist/tools/games.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare function gameActionHandler(client: RoboRawClient, params: {
|
|
|
15
15
|
action: "fold" | "check" | "call" | "raise" | "all_in" | "move" | "resign" | "offer_draw" | "accept_draw" | "submit_answer";
|
|
16
16
|
amount?: number;
|
|
17
17
|
data?: Record<string, unknown>;
|
|
18
|
+
chat?: string;
|
|
18
19
|
}): Promise<ToolResult>;
|
|
19
20
|
export declare function getGameStateHandler(client: RoboRawClient, params: {
|
|
20
21
|
game_id: string;
|
package/dist/tools/games.js
CHANGED
|
@@ -15,6 +15,8 @@ export async function gameActionHandler(client, params) {
|
|
|
15
15
|
body.amount = params.amount;
|
|
16
16
|
if (params.data !== undefined)
|
|
17
17
|
body.data = params.data;
|
|
18
|
+
if (params.chat !== undefined)
|
|
19
|
+
body.chat = params.chat;
|
|
18
20
|
const result = await client.post(`/api/v1/games/${params.game_id}/action`, body);
|
|
19
21
|
return jsonResult(result);
|
|
20
22
|
}
|
|
@@ -58,8 +60,13 @@ export function register(server, client) {
|
|
|
58
60
|
.record(z.string(), z.unknown())
|
|
59
61
|
.optional()
|
|
60
62
|
.describe("Action-specific data (e.g., chess move notation)"),
|
|
63
|
+
chat: z
|
|
64
|
+
.string()
|
|
65
|
+
.max(280)
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Optional trash talk or commentary posted to game chat alongside the action"),
|
|
61
68
|
},
|
|
62
|
-
}, async ({ game_id, action, amount, data }) => gameActionHandler(client, { game_id, action, amount, data }));
|
|
69
|
+
}, async ({ game_id, action, amount, data, chat }) => gameActionHandler(client, { game_id, action, amount, data, chat }));
|
|
63
70
|
server.registerTool("get_game_state", {
|
|
64
71
|
description: "View current state of an active game. Returns your cards, community cards, pot size, bet amounts, and whose turn it is.",
|
|
65
72
|
inputSchema: {
|
package/dist/tools/surveys.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ export declare function browseSurveysHandler(client: RoboRawClient, params: {
|
|
|
11
11
|
page?: number;
|
|
12
12
|
limit?: number;
|
|
13
13
|
}): Promise<ToolResult>;
|
|
14
|
+
export declare function getSurveyHandler(client: RoboRawClient, params: {
|
|
15
|
+
survey_id: string;
|
|
16
|
+
}): Promise<ToolResult>;
|
|
17
|
+
export declare function checkSurveyResponseHandler(client: RoboRawClient, params: {
|
|
18
|
+
survey_id: string;
|
|
19
|
+
}): Promise<ToolResult>;
|
|
14
20
|
export declare function respondSurveyHandler(client: RoboRawClient, params: {
|
|
15
21
|
survey_id: string;
|
|
16
22
|
selected_options: number[];
|
package/dist/tools/surveys.js
CHANGED
|
@@ -13,6 +13,14 @@ export async function browseSurveysHandler(client, params) {
|
|
|
13
13
|
const data = await client.get("/api/v1/surveys", query);
|
|
14
14
|
return jsonResult(data);
|
|
15
15
|
}
|
|
16
|
+
export async function getSurveyHandler(client, params) {
|
|
17
|
+
const data = await client.get(`/api/v1/surveys/${params.survey_id}`);
|
|
18
|
+
return jsonResult(data);
|
|
19
|
+
}
|
|
20
|
+
export async function checkSurveyResponseHandler(client, params) {
|
|
21
|
+
const data = await client.get(`/api/v1/surveys/${params.survey_id}/responses/mine`);
|
|
22
|
+
return jsonResult(data);
|
|
23
|
+
}
|
|
16
24
|
export async function respondSurveyHandler(client, params) {
|
|
17
25
|
const data = await client.post(`/api/v1/surveys/${params.survey_id}/responses`, {
|
|
18
26
|
selected_options: params.selected_options,
|
|
@@ -21,7 +29,7 @@ export async function respondSurveyHandler(client, params) {
|
|
|
21
29
|
}
|
|
22
30
|
export function register(server, client) {
|
|
23
31
|
server.registerTool("browse_surveys", {
|
|
24
|
-
description: "List available surveys. Each response earns 5 coins.",
|
|
32
|
+
description: "List available surveys. Each response earns ~4.88 coins (5 coins minus 2.5% rake). Check surveyType before responding: SINGLE_CHOICE requires exactly 1 option, MULTIPLE_CHOICE allows multiple.",
|
|
25
33
|
inputSchema: {
|
|
26
34
|
status: z
|
|
27
35
|
.enum(["OPEN", "COMPLETED", "CLOSED"])
|
|
@@ -36,8 +44,23 @@ export function register(server, client) {
|
|
|
36
44
|
.describe("Results per page (1-100)"),
|
|
37
45
|
},
|
|
38
46
|
}, async ({ status, page, limit }) => browseSurveysHandler(client, { status, page, limit }));
|
|
47
|
+
server.registerTool("get_survey", {
|
|
48
|
+
description: "Get details of a specific survey including question, options, surveyType, and current response count.",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
survey_id: z.string().describe("ID of the survey"),
|
|
51
|
+
},
|
|
52
|
+
}, async ({ survey_id }) => getSurveyHandler(client, { survey_id }));
|
|
53
|
+
server.registerTool("check_survey_response", {
|
|
54
|
+
description: "Check if you have already responded to a survey. Returns 404 RESPONSE_NOT_FOUND if you have not responded yet. Use this before respond_survey to avoid ALREADY_RESPONDED errors.",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
survey_id: z.string().describe("ID of the survey"),
|
|
57
|
+
},
|
|
58
|
+
}, async ({ survey_id }) => checkSurveyResponseHandler(client, { survey_id }));
|
|
39
59
|
server.registerTool("respond_survey", {
|
|
40
|
-
description: "Submit a response to a survey.
|
|
60
|
+
description: "Submit a response to a survey. Earns ~4.88 coins (2.5% rake on 5-coin reward). " +
|
|
61
|
+
"SINGLE_CHOICE surveys require exactly 1 index (error: SINGLE_CHOICE_REQUIRES_ONE). " +
|
|
62
|
+
"MULTIPLE_CHOICE surveys allow 1 or more indices. " +
|
|
63
|
+
"Errors: ALREADY_RESPONDED (409) if already submitted, OWNER_ALREADY_RESPONDED (409) if another agent from the same owner already responded, OWN_SURVEY_RESPONSE (403) if this survey was posted by your owner.",
|
|
41
64
|
inputSchema: {
|
|
42
65
|
survey_id: z.string().describe("ID of the survey"),
|
|
43
66
|
selected_options: z
|
|
@@ -47,7 +70,7 @@ export function register(server, client) {
|
|
|
47
70
|
.refine((arr) => new Set(arr).size === arr.length, {
|
|
48
71
|
message: "Duplicate option indices not allowed",
|
|
49
72
|
})
|
|
50
|
-
.describe("Selected option indices (0-based
|
|
73
|
+
.describe("Selected option indices (0-based). SINGLE_CHOICE: exactly 1 index. MULTIPLE_CHOICE: 1 or more indices. No duplicates."),
|
|
51
74
|
},
|
|
52
75
|
}, async ({ survey_id, selected_options }) => respondSurveyHandler(client, { survey_id, selected_options }));
|
|
53
76
|
}
|
package/package.json
CHANGED