get_policies
Retrieve spending limits, whitelists, rate limits, and other rules applied to a wallet.
Instructions
Get policies applied to the wallet. Shows spending limits, whitelists, rate limits, and other rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet. | |
| limit | No | Max items to return (default: 50) | |
| offset | No | Number of items to skip (default: 0) |
Implementation Reference
- Primary handler + registration for the 'get_policies' tool. Defines the tool with Zod schema (wallet_id, limit, offset), makes a GET /v1/policies request via the ApiClient, and returns results via toToolResult. Registered as 'get_policies' on the MCP server.
export function registerGetPolicies(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void { server.tool( 'get_policies', withWalletPrefix('Get policies applied to the wallet. Shows spending limits, whitelists, rate limits, and other rules.', walletContext?.walletName), { wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), limit: z.number().int().min(1).max(200).optional().describe('Max items to return (default: 50)'), offset: z.number().int().min(0).optional().describe('Number of items to skip (default: 0)'), }, async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('walletId', args.wallet_id); if (args.limit !== undefined) params.set('limit', String(args.limit)); if (args.offset !== undefined) params.set('offset', String(args.offset)); const qs = params.toString(); const result = await apiClient.get('/v1/policies' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); } - Input schema for get_policies: optional wallet_id (string), limit (int 1-200, default 50), offset (int >=0, default 0).
{ wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), limit: z.number().int().min(1).max(200).optional().describe('Max items to return (default: 50)'), offset: z.number().int().min(0).optional().describe('Number of items to skip (default: 0)'), }, - packages/mcp/src/server.ts:91-91 (registration)Registration call in the main MCP server: registerGetPolicies(server, apiClient, walletContext) on line 91.
registerGetPolicies(server, apiClient, walletContext); - packages/mcp/src/server.ts:34-34 (registration)Import of registerGetPolicies from './tools/get-policies.js'.
import { registerGetPolicies } from './tools/get-policies.js'; - Alternate implementation of get_policies in the OpenClaw plugin (Tool 15). Uses the same GET /v1/policies endpoint with similar input schema but registered via PluginApi.registerTool.
// Tool 15: get_policies api.registerTool({ name: 'get_policies', description: 'Get policies applied to the wallet. Shows spending limits, whitelists, rate limits, and other rules.', inputSchema: { type: 'object', properties: { wallet_id: { type: 'string', description: 'Target wallet ID.' }, limit: { type: 'number', description: 'Max items to return (default: 50)' }, offset: { type: 'number', description: 'Number of items to skip (default: 0)' }, }, }, handler: async (args) => { const params = new URLSearchParams(); if (typeof args['wallet_id'] === 'string') params.set('walletId', args['wallet_id']); if (args['limit'] !== undefined) params.set('limit', String(args['limit'])); if (args['offset'] !== undefined) params.set('offset', String(args['offset'])); const qs = params.toString(); const result = await client.get('/v1/policies' + (qs ? '?' + qs : '')); return toResult(result); }, });