tmcp 1.4.0 → 1.6.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.
@@ -6,12 +6,16 @@ import {
6
6
  CallToolResult,
7
7
  ReadResourceResult,
8
8
  CompleteResult,
9
- InitializeRequest,
9
+ InitializeRequestParams,
10
+ Resource,
11
+ ServerCapabilities,
12
+ LoggingLevel
10
13
  } from '../validation/index.js';
11
14
 
12
15
  export type Tool<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = {
13
16
  description: string;
14
17
  schema: TSchema;
18
+ title?: string;
15
19
  execute: (
16
20
  input?: StandardSchemaV1.InferInput<TSchema>,
17
21
  ) => Promise<CallToolResult> | CallToolResult;
@@ -25,16 +29,21 @@ export type Completion = (
25
29
  export type Prompt<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = {
26
30
  description: string;
27
31
  schema: TSchema;
32
+ title?: string;
28
33
  execute: (
29
34
  input?: StandardSchemaV1.InferInput<TSchema>,
30
35
  ) => Promise<GetPromptResult> | GetPromptResult;
31
36
  };
32
37
 
33
- export type Resource =
38
+ export type StoredResource =
34
39
  | {
35
40
  description: string;
36
41
  name: string;
37
42
  template: true;
43
+ title?: string;
44
+ list_resources?: () =>
45
+ | Promise<Array<Resource>>
46
+ | Array<Resource>;
38
47
  execute: (
39
48
  uri: string,
40
49
  params: Record<string, string | string[]>,
@@ -44,19 +53,23 @@ export type Resource =
44
53
  description: string;
45
54
  name: string;
46
55
  template: false;
56
+ title?: string;
47
57
  execute: (
48
58
  uri: string,
49
59
  ) => Promise<ReadResourceResult> | ReadResourceResult;
50
60
  };
51
61
 
52
62
  export type ServerOptions<TSchema extends StandardSchemaV1> = {
53
- capabilities?: {
54
- tools?: { listChanged?: boolean };
55
- resources?: { listChanged?: boolean; subscribe?: boolean };
56
- prompts?: { listChanged?: boolean };
57
- };
63
+ capabilities?: ServerCapabilities;
58
64
  instructions?: string;
59
65
  adapter: JsonSchemaAdapter<TSchema>;
66
+ pagination?: {
67
+ resources?: { size?: number };
68
+ prompts?: { size?: number };
69
+ };
70
+ logging?: {
71
+ default: LoggingLevel;
72
+ }
60
73
  };
61
74
 
62
75
  export type ServerInfo = {
@@ -74,5 +87,5 @@ export type McpEvents = {
74
87
  sessions?: string[] | undefined;
75
88
  };
76
89
  }) => void;
77
- initialize: (initialize_request: InitializeRequest) => void;
90
+ initialize: (initialize_request: InitializeRequestParams) => void;
78
91
  };