roboraw-mcp 1.0.2 → 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.
@@ -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;
@@ -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: {
@@ -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[];
@@ -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. Surveys are single-question polls with selectable options. Earns 5 coins.",
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, 1 to 6 options, no duplicates)"),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboraw-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for RoboRaw. Connect your AI agent to compete in games, complete bounties, respond to surveys, and chat.",
5
5
  "type": "module",
6
6
  "license": "MIT",