admin_set_limits
Set rate limits per action category for an account, updating only specified limits while leaving others unchanged. Supports daily, weekly, or monthly periods for profile views, connections, messages, and more.
Instructions
Set rate limits for an account. Only specified limits are created or updated; other limits remain unchanged. Categories: stPersonProfileViews, stCompanyPageViews, stConnectionRequests, stMessages, stSearchQueries, stReactions, stComments, stPosts, nvPersonProfileViews, nvCompanyPageViews, nvMessages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | Account UUID | |
| limits | Yes | Array of limit configurations |
Implementation Reference
- src/tools/admin-set-limits.ts:21-29 (handler)The execute method that actually sets the limits by calling admin.limits.set(args)
public override async execute({ admin, args, }: { admin: LinkedApiAdmin; args: TSetLimitsParams; }): Promise<void> { await admin.limits.set(args); } - src/tools/admin-set-limits.ts:9-19 (schema)Zod schema defining input validation: accountId (string), limits (array of objects with category, period, maxValue, isEnabled)
protected readonly schema = z.object({ accountId: z.string(), limits: z.array( z.object({ category: z.string(), period: z.enum(['daily', 'weekly', 'monthly']), maxValue: z.number().int().min(0), isEnabled: z.boolean().optional(), }), ), }); - src/linked-api-tools.ts:89-91 (registration)Registration of AdminSetLimitsTool in the adminTools array within LinkedApiTools constructor
new AdminSetLimitsTool(), new AdminResetLimitsTool(), ]; - src/utils/admin-tool.ts:1-22 (helper)Base AdminTool abstract class that AdminSetLimitsTool extends, providing the validate method and abstract execute/getTool contracts
import { LinkedApiAdmin } from '@linkedapi/node'; import { Tool } from '@modelcontextprotocol/sdk/types.js'; import z from 'zod'; export abstract class AdminTool<TParams, TResult> { public abstract readonly name: string; protected abstract readonly schema: z.ZodSchema; public abstract getTool(): Tool; public validate(args: unknown): TParams { return this.schema.parse(args) as TParams; } public abstract execute({ admin, args, }: { admin: LinkedApiAdmin; args: TParams; }): Promise<TResult>; } - src/tools/admin-set-limits.ts:31-74 (handler)getTool() returning the full MCP Tool definition with name, description, and JSON Schema input schema
public override getTool(): Tool { return { name: this.name, description: 'Set rate limits for an account. Only specified limits are created or updated; other limits remain unchanged. Categories: stPersonProfileViews, stCompanyPageViews, stConnectionRequests, stMessages, stSearchQueries, stReactions, stComments, stPosts, nvPersonProfileViews, nvCompanyPageViews, nvMessages.', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'Account UUID', }, limits: { type: 'array', description: 'Array of limit configurations', items: { type: 'object', properties: { category: { type: 'string', description: 'Limit category', }, period: { type: 'string', enum: ['daily', 'weekly', 'monthly'], description: 'Limit period', }, maxValue: { type: 'number', description: 'Maximum allowed actions (>= 0)', }, isEnabled: { type: 'boolean', description: 'Whether this limit is enforced (default: true)', }, }, required: ['category', 'period', 'maxValue'], }, }, }, required: ['accountId', 'limits'], }, }; }