@solworks/poll-mcp 0.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/README.md +121 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +97 -0
- package/dist/prompts/index.d.ts +19 -0
- package/dist/prompts/index.js +100 -0
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.js +83 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.js +686 -0
- package/package.json +28 -0
- package/tests/integration/server.test.ts +159 -0
- package/tests/security/excluded-endpoints.test.ts +25 -0
- package/tests/security/scope-enforcement.test.ts +66 -0
- package/tests/security/token-handling.test.ts +30 -0
- package/tests/unit/resources.test.ts +78 -0
- package/tests/unit/tools/bets.test.ts +116 -0
- package/tests/unit/tools/leaderboard.test.ts +45 -0
- package/tests/unit/tools/social.test.ts +47 -0
- package/tests/unit/tools/user.test.ts +49 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +9 -0
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# poll-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [Poll.fun](https://poll.fun). Gives Claude Desktop (and other MCP-compatible AI assistants) access to the Poll.fun betting platform — browse bets, place wagers, manage your account, and more.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### 1. Build
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd poll-mcp && npm install && npm run build
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Create a token
|
|
14
|
+
|
|
15
|
+
Use the CLI or web UI to create a Personal Access Token:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
poll auth token create --name "claude-desktop" --scopes read,bet:write,social:write --expires 90d
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 3. Configure Claude Desktop
|
|
22
|
+
|
|
23
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"poll-fun": {
|
|
29
|
+
"command": "node",
|
|
30
|
+
"args": ["/absolute/path/to/poll-mcp/dist/index.js"],
|
|
31
|
+
"env": {
|
|
32
|
+
"POLL_API_TOKEN": "polld_your_token_here"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Restart Claude Desktop. You should see "poll-fun" in the MCP server list.
|
|
40
|
+
|
|
41
|
+
### Environment Variables
|
|
42
|
+
|
|
43
|
+
| Variable | Default | Description |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `POLL_API_TOKEN` | *(required)* | Personal Access Token |
|
|
46
|
+
| `POLL_API_URL` | `https://api.poll.fun` | API endpoint override |
|
|
47
|
+
|
|
48
|
+
## Tools (27)
|
|
49
|
+
|
|
50
|
+
### Read (`read` scope)
|
|
51
|
+
|
|
52
|
+
| Tool | Description |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `get_account` | Your account info |
|
|
55
|
+
| `get_profile` | User profile by UUID (or your own) |
|
|
56
|
+
| `get_balance` | XP and USDC balances |
|
|
57
|
+
| `list_public_bets` | Public bets with pagination |
|
|
58
|
+
| `get_trending_bets` | Currently trending bets |
|
|
59
|
+
| `get_bet` | Bet details by ID or address |
|
|
60
|
+
| `get_my_wagers` | Your wagers (optionally active only) |
|
|
61
|
+
| `get_leaderboard` | Platform leaderboard |
|
|
62
|
+
| `get_my_ranking` | Your leaderboard ranking |
|
|
63
|
+
| `get_wallet_transactions` | Wallet transaction history |
|
|
64
|
+
| `get_friends` | Friends list |
|
|
65
|
+
| `get_notifications` | Notifications with pagination |
|
|
66
|
+
| `get_streak` | Current and longest betting streak |
|
|
67
|
+
| `get_favourite_bets` | Your favourite bets |
|
|
68
|
+
| `get_probability_history` | Probability history for a bet |
|
|
69
|
+
|
|
70
|
+
### Bet Write (`bet:write` scope)
|
|
71
|
+
|
|
72
|
+
| Tool | Description |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `create_bet` | Create a bet with question and options |
|
|
75
|
+
| `join_bet` | Join an existing bet |
|
|
76
|
+
| `place_wager` | Place a wager on a bet option |
|
|
77
|
+
| `cancel_wager` | Cancel a placed wager |
|
|
78
|
+
| `initiate_vote` | Start the voting phase |
|
|
79
|
+
| `vote` | Cast a vote on a bet outcome |
|
|
80
|
+
| `settle_bet` | Settle a bet and distribute winnings |
|
|
81
|
+
|
|
82
|
+
### User Write (`user:write` scope)
|
|
83
|
+
|
|
84
|
+
| Tool | Description |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `update_display_name` | Change your display name |
|
|
87
|
+
|
|
88
|
+
### Social Write (`social:write` scope)
|
|
89
|
+
|
|
90
|
+
| Tool | Description |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `send_friend_request` | Send a friend request |
|
|
93
|
+
| `respond_friend_request` | Accept or decline a friend request |
|
|
94
|
+
| `favourite_bet` | Add a bet to favourites |
|
|
95
|
+
| `unfavourite_bet` | Remove a bet from favourites |
|
|
96
|
+
|
|
97
|
+
## Resources (5)
|
|
98
|
+
|
|
99
|
+
| URI | Description |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `poll://user/profile` | Current user profile |
|
|
102
|
+
| `poll://user/balances` | XP and USDC balances |
|
|
103
|
+
| `poll://bets/active` | Your active bets and wagers |
|
|
104
|
+
| `poll://bets/trending` | Currently trending bets |
|
|
105
|
+
| `poll://leaderboard/top10` | Top 10 leaderboard |
|
|
106
|
+
|
|
107
|
+
## Prompts (3)
|
|
108
|
+
|
|
109
|
+
| Prompt | Description |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `analyze_bet` | Analyze a specific bet's dynamics and outcomes |
|
|
112
|
+
| `suggest_bets` | Suggest bets from trending, considering your balance |
|
|
113
|
+
| `portfolio_review` | Review your betting portfolio with insights |
|
|
114
|
+
|
|
115
|
+
## Security
|
|
116
|
+
|
|
117
|
+
- `wallet:sensitive` scope is never available via PAT — private key endpoints always return 403
|
|
118
|
+
- PATs cannot create other PATs (escalation prevention)
|
|
119
|
+
- Scopes are enforced server-side per-endpoint; a token with only `read` scope cannot place wagers
|
|
120
|
+
- HTTPS enforced for all non-localhost API URLs
|
|
121
|
+
- If the token is invalid or expired, tools return clear error messages (the server stays running)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { PollClient } from 'poll-api-client';
|
|
4
|
+
export interface McpServerConfig {
|
|
5
|
+
apiToken: string;
|
|
6
|
+
apiUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createServer(config?: McpServerConfig, clientOverride?: PollClient): McpServer;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { PollClient } from 'poll-api-client';
|
|
6
|
+
import { TOOL_DEFINITIONS } from './tools/index.js';
|
|
7
|
+
import { RESOURCE_DEFINITIONS } from './resources/index.js';
|
|
8
|
+
import { PROMPT_DEFINITIONS } from './prompts/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Convert a JSON Schema property type to a Zod schema.
|
|
11
|
+
*/
|
|
12
|
+
function jsonPropToZod(prop) {
|
|
13
|
+
const desc = prop.description ?? '';
|
|
14
|
+
switch (prop.type) {
|
|
15
|
+
case 'number':
|
|
16
|
+
return z.number().describe(desc);
|
|
17
|
+
case 'boolean':
|
|
18
|
+
return z.boolean().describe(desc);
|
|
19
|
+
case 'array':
|
|
20
|
+
return z.array(z.string()).describe(desc);
|
|
21
|
+
default:
|
|
22
|
+
return z.string().describe(desc);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function createServer(config, clientOverride) {
|
|
26
|
+
const server = new McpServer({ name: 'poll-fun', version: '0.1.0' }, { capabilities: { tools: {}, resources: {}, prompts: {} } });
|
|
27
|
+
const client = clientOverride ??
|
|
28
|
+
new PollClient({
|
|
29
|
+
apiUrl: config?.apiUrl ?? 'https://api.poll.fun',
|
|
30
|
+
token: config?.apiToken ?? '',
|
|
31
|
+
clientId: 'poll-mcp',
|
|
32
|
+
});
|
|
33
|
+
// Register tools
|
|
34
|
+
for (const tool of Object.values(TOOL_DEFINITIONS)) {
|
|
35
|
+
const jsonProps = (tool.inputSchema.properties ?? {});
|
|
36
|
+
const requiredFields = (tool.inputSchema.required ?? []);
|
|
37
|
+
const hasParams = Object.keys(jsonProps).length > 0;
|
|
38
|
+
if (hasParams) {
|
|
39
|
+
const shape = {};
|
|
40
|
+
for (const [key, prop] of Object.entries(jsonProps)) {
|
|
41
|
+
let zodType = jsonPropToZod(prop);
|
|
42
|
+
if (!requiredFields.includes(key)) {
|
|
43
|
+
zodType = zodType.optional();
|
|
44
|
+
}
|
|
45
|
+
shape[key] = zodType;
|
|
46
|
+
}
|
|
47
|
+
// Use the deprecated tool() API which is simpler and avoids deep type recursion
|
|
48
|
+
server.tool(tool.name, tool.description, shape, async (args) => {
|
|
49
|
+
return tool.handler(args, client);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
server.tool(tool.name, tool.description, async () => {
|
|
54
|
+
return tool.handler({}, client);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Register resources
|
|
59
|
+
for (const resource of RESOURCE_DEFINITIONS) {
|
|
60
|
+
server.resource(resource.name, resource.uri, { description: resource.description, mimeType: resource.mimeType }, async (uri) => {
|
|
61
|
+
const text = await resource.handler(client);
|
|
62
|
+
return { contents: [{ uri: uri.href, text, mimeType: resource.mimeType }] };
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Register prompts
|
|
66
|
+
for (const prompt of PROMPT_DEFINITIONS) {
|
|
67
|
+
if (prompt.arguments && prompt.arguments.length > 0) {
|
|
68
|
+
const argsSchema = {};
|
|
69
|
+
for (const arg of prompt.arguments) {
|
|
70
|
+
let zodType = z.string().describe(arg.description);
|
|
71
|
+
if (!arg.required) {
|
|
72
|
+
zodType = zodType.optional();
|
|
73
|
+
}
|
|
74
|
+
argsSchema[arg.name] = zodType;
|
|
75
|
+
}
|
|
76
|
+
server.prompt(prompt.name, prompt.description, argsSchema, async (args) => {
|
|
77
|
+
return prompt.handler(args);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
server.prompt(prompt.name, prompt.description, async () => {
|
|
82
|
+
return prompt.handler({});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return server;
|
|
87
|
+
}
|
|
88
|
+
async function main() {
|
|
89
|
+
const config = {
|
|
90
|
+
apiToken: process.env.POLL_API_TOKEN || '',
|
|
91
|
+
apiUrl: process.env.POLL_API_URL || 'https://api.poll.fun',
|
|
92
|
+
};
|
|
93
|
+
const server = createServer(config);
|
|
94
|
+
const transport = new StdioServerTransport();
|
|
95
|
+
await server.connect(transport);
|
|
96
|
+
}
|
|
97
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PromptDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
arguments?: Array<{
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
handler: (args: Record<string, string>) => {
|
|
10
|
+
messages: Array<{
|
|
11
|
+
role: 'user' | 'assistant';
|
|
12
|
+
content: {
|
|
13
|
+
type: 'text';
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const PROMPT_DEFINITIONS: PromptDefinition[];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export const PROMPT_DEFINITIONS = [
|
|
2
|
+
{
|
|
3
|
+
name: 'analyze_bet',
|
|
4
|
+
description: 'Analyze a specific bet to understand its dynamics, options, and potential outcomes',
|
|
5
|
+
arguments: [
|
|
6
|
+
{
|
|
7
|
+
name: 'betAddress',
|
|
8
|
+
description: 'The bet address or ID to analyze',
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
handler(args) {
|
|
13
|
+
const betAddress = args.betAddress ?? '';
|
|
14
|
+
return {
|
|
15
|
+
messages: [
|
|
16
|
+
{
|
|
17
|
+
role: 'user',
|
|
18
|
+
content: {
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: [
|
|
21
|
+
`Please analyze the bet with address "${betAddress}".`,
|
|
22
|
+
'',
|
|
23
|
+
'Use the get_bet tool to fetch the bet details, and get_probability_history to see how odds have changed.',
|
|
24
|
+
'',
|
|
25
|
+
'In your analysis, please cover:',
|
|
26
|
+
'1. What the bet is about and its current status',
|
|
27
|
+
'2. The available options and their implied probabilities',
|
|
28
|
+
'3. The total volume and level of participation',
|
|
29
|
+
'4. How the probabilities have trended over time',
|
|
30
|
+
'5. Any notable patterns or insights',
|
|
31
|
+
'6. A recommendation on whether this bet presents good value',
|
|
32
|
+
].join('\n'),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'suggest_bets',
|
|
41
|
+
description: 'Suggest interesting bets from the currently trending bets',
|
|
42
|
+
arguments: [],
|
|
43
|
+
handler() {
|
|
44
|
+
return {
|
|
45
|
+
messages: [
|
|
46
|
+
{
|
|
47
|
+
role: 'user',
|
|
48
|
+
content: {
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: [
|
|
51
|
+
'Please suggest some interesting bets I could participate in.',
|
|
52
|
+
'',
|
|
53
|
+
'Use the get_trending_bets tool to see what is currently popular, and also check my balance with get_balance.',
|
|
54
|
+
'',
|
|
55
|
+
'For each suggestion, please explain:',
|
|
56
|
+
'1. What the bet is about',
|
|
57
|
+
'2. Why it is interesting or has good value',
|
|
58
|
+
'3. Which option you would lean towards and why',
|
|
59
|
+
'4. A suggested wager amount based on my balance',
|
|
60
|
+
].join('\n'),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'portfolio_review',
|
|
69
|
+
description: 'Review your current betting portfolio and provide insights',
|
|
70
|
+
arguments: [],
|
|
71
|
+
handler() {
|
|
72
|
+
return {
|
|
73
|
+
messages: [
|
|
74
|
+
{
|
|
75
|
+
role: 'user',
|
|
76
|
+
content: {
|
|
77
|
+
type: 'text',
|
|
78
|
+
text: [
|
|
79
|
+
'Please review my betting portfolio.',
|
|
80
|
+
'',
|
|
81
|
+
'Use these tools to gather my information:',
|
|
82
|
+
'- get_balance for my current balances',
|
|
83
|
+
'- get_my_wagers for my active and past wagers',
|
|
84
|
+
'- get_my_ranking for my leaderboard position',
|
|
85
|
+
'- get_streak for my betting streak',
|
|
86
|
+
'',
|
|
87
|
+
'Please provide:',
|
|
88
|
+
'1. A summary of my current positions and exposure',
|
|
89
|
+
'2. My win/loss performance',
|
|
90
|
+
'3. My leaderboard standing and streak',
|
|
91
|
+
'4. Suggestions for improving my betting strategy',
|
|
92
|
+
'5. Any risks I should be aware of',
|
|
93
|
+
].join('\n'),
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PollClient } from 'poll-api-client';
|
|
2
|
+
export interface ResourceDefinition {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
handler: (client: PollClient) => Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
export declare const RESOURCE_DEFINITIONS: ResourceDefinition[];
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const RESOURCE_DEFINITIONS = [
|
|
2
|
+
{
|
|
3
|
+
uri: 'poll://user/profile',
|
|
4
|
+
name: 'User Profile',
|
|
5
|
+
description: 'Current user profile information',
|
|
6
|
+
mimeType: 'text/plain',
|
|
7
|
+
async handler(client) {
|
|
8
|
+
const profile = await client.getProfile();
|
|
9
|
+
const lines = [
|
|
10
|
+
`User Profile:`,
|
|
11
|
+
` Display Name: ${profile.displayName ?? 'Not set'}`,
|
|
12
|
+
` UUID: ${profile.uuid}`,
|
|
13
|
+
];
|
|
14
|
+
return lines.join('\n');
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
uri: 'poll://user/balances',
|
|
19
|
+
name: 'User Balances',
|
|
20
|
+
description: 'Current XP and USDC balances',
|
|
21
|
+
mimeType: 'text/plain',
|
|
22
|
+
async handler(client) {
|
|
23
|
+
const [xp, usdc] = await Promise.all([
|
|
24
|
+
client.getXpBalance(),
|
|
25
|
+
client.getUsdcBalance(),
|
|
26
|
+
]);
|
|
27
|
+
const lines = [
|
|
28
|
+
`Balances:`,
|
|
29
|
+
` XP: ${xp.xp}`,
|
|
30
|
+
` USDC: ${usdc.usdc ?? 'N/A'}`,
|
|
31
|
+
];
|
|
32
|
+
return lines.join('\n');
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
uri: 'poll://bets/active',
|
|
37
|
+
name: 'Active Bets',
|
|
38
|
+
description: 'Your active bets and wagers',
|
|
39
|
+
mimeType: 'text/plain',
|
|
40
|
+
async handler(client) {
|
|
41
|
+
const [bets, wagers] = await Promise.all([
|
|
42
|
+
client.getMyBets(),
|
|
43
|
+
client.getMyWagers(),
|
|
44
|
+
]);
|
|
45
|
+
const betLines = bets.map((b, i) => ` ${i + 1}. ${b.question} — Status: ${b.status}`);
|
|
46
|
+
const wagerLines = wagers.map((w, i) => ` ${i + 1}. Bet: ${w.betAddress} — Amount: ${w.amount}, Status: ${w.status}`);
|
|
47
|
+
return [
|
|
48
|
+
`Your Bets (${bets.length}):`,
|
|
49
|
+
...(betLines.length > 0 ? betLines : [' None']),
|
|
50
|
+
'',
|
|
51
|
+
`Your Wagers (${wagers.length}):`,
|
|
52
|
+
...(wagerLines.length > 0 ? wagerLines : [' None']),
|
|
53
|
+
].join('\n');
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
uri: 'poll://bets/trending',
|
|
58
|
+
name: 'Trending Bets',
|
|
59
|
+
description: 'Currently trending bets on the platform',
|
|
60
|
+
mimeType: 'text/plain',
|
|
61
|
+
async handler(client) {
|
|
62
|
+
const bets = await client.getTrendingBets();
|
|
63
|
+
if (bets.length === 0)
|
|
64
|
+
return 'No trending bets found.';
|
|
65
|
+
const lines = bets.map((b, i) => `${i + 1}. ${b.question} — Volume: ${b.totalVolume ?? 'N/A'}`);
|
|
66
|
+
return `Trending Bets:\n${lines.join('\n')}`;
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
uri: 'poll://leaderboard/top10',
|
|
71
|
+
name: 'Leaderboard Top 10',
|
|
72
|
+
description: 'Top 10 users on the leaderboard',
|
|
73
|
+
mimeType: 'text/plain',
|
|
74
|
+
async handler(client) {
|
|
75
|
+
const entries = await client.getLeaderboard();
|
|
76
|
+
const top10 = entries.slice(0, 10);
|
|
77
|
+
if (top10.length === 0)
|
|
78
|
+
return 'Leaderboard is empty.';
|
|
79
|
+
const lines = top10.map((e) => `#${e.rank} ${e.displayName ?? 'Anonymous'} — ${e.points} pts`);
|
|
80
|
+
return `Leaderboard (Top 10):\n${lines.join('\n')}`;
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PollClient } from 'poll-api-client';
|
|
2
|
+
export interface ToolDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: Record<string, unknown>;
|
|
6
|
+
requiredScope: string;
|
|
7
|
+
handler: (args: Record<string, unknown>, client: PollClient) => Promise<{
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}>;
|
|
12
|
+
isError?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare const TOOL_DEFINITIONS: Record<string, ToolDefinition>;
|