example_tool
Perform Instagram operations through the Insta MCP Server to interact with Instagram features using the Model Context Protocol.
Instructions
Example tool template for Instagram operations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| param1 | Yes | Example parameter |
Input Schema (JSON Schema)
{
"properties": {
"param1": {
"description": "Example parameter",
"type": "string"
}
},
"required": [
"param1"
],
"type": "object"
}
Implementation Reference
- src/tools/example.ts:28-48 (handler)The `execute` method of `ExampleTool` class implements the core logic for the 'example_tool'. It validates the IGPAPI client initialization, accesses the client, and returns a sample result based on the input parameter.async execute(args: { param1: string }): Promise<ToolResult> { // Ensure IGPAPI client is initialized if (!igpapiClient.isInitialized()) { throw new Error("IGPAPI client not initialized"); } const client = igpapiClient.getClient(); // TODO: Implement tool logic using IGPAPI client // Example: // const result = await client.someMethod(args.param1); return { content: [ { type: "text", text: `Example tool executed with param1: ${args.param1}`, }, ], }; }
- src/tools/example.ts:11-26 (schema)The `getDefinition` method defines the tool's metadata including name 'example_tool', description, and input schema requiring a 'param1' string parameter.getDefinition(): ToolDefinition { return { name: "example_tool", description: "Example tool template for Instagram operations", inputSchema: { type: "object", properties: { param1: { type: "string", description: "Example parameter", }, }, required: ["param1"], }, }; }
- src/tools/example.ts:6-6 (registration)Import statement for the ExampleTool class in the tools index file, which is used for tool registry and making it available for instantiation and registration.import { BaseTool } from "./base.js";