chore: add instructions docs (#1778)

This commit is contained in:
Konstantin Konstantinov 2026-03-27 14:19:32 +02:00 • committed by GitHub
commit 5516c1ba66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,27 @@ import type { CallToolResult, ResourceLink } from '@modelcontextprotocol/server'
import { completable, McpServer, ResourceTemplate, StdioServerTransport } from '@modelcontextprotocol/server';
import * as z from 'zod/v4';
// ---------------------------------------------------------------------------
// Instructions
// ---------------------------------------------------------------------------
/** Example: Providing server instructions to guide LLM usage. */
function instructions_basic() {
//#region instructions_basic
const server = new McpServer(
{
name: 'multi-tool-server',
version: '1.0.0'
},
{
instructions: `This server provides data-pipeline tools. Always call "validate-schema"
before calling "transform-data" to avoid runtime errors.`
}
);
//#endregion instructions_basic
return server;
}
// ---------------------------------------------------------------------------
// Tools, resources, and prompts
// ---------------------------------------------------------------------------
@ -373,6 +394,7 @@ function dnsRebinding_allowedHosts() {
}
// Suppress unused-function warnings (functions exist solely for type-checking)
void instructions_basic;
void registerTool_basic;
void registerTool_resourceLink;
void registerTool_logging;