tmcp 1.11.0 → 1.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmcp",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "The main tmcp library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -973,10 +973,11 @@ export class McpServer {
973
973
  * If the client doesn't support elicitation, it will throw an error.
974
974
  *
975
975
  * @template {StandardSchema extends undefined ? never : StandardSchema} TSchema
976
+ * @param {string} message
976
977
  * @param {TSchema} schema
977
978
  * @returns {Promise<StandardSchemaV1.InferOutput<TSchema>>}
978
979
  */
979
- async elicitation(schema) {
980
+ async elicitation(message, schema) {
980
981
  if (!this.#client_capabilities?.elicitation)
981
982
  throw new McpError(-32601, "Client doesn't support elicitation");
982
983
 
@@ -985,7 +986,9 @@ export class McpServer {
985
986
  await this.#client?.request(
986
987
  'elicitation/create',
987
988
  {
988
- params: await this.#options.adapter.toJsonSchema(schema),
989
+ message,
990
+ requestedSchema:
991
+ await this.#options.adapter.toJsonSchema(schema),
989
992
  },
990
993
  {
991
994
  sessions: [this.#session_id],
@@ -120,7 +120,7 @@ declare module 'tmcp' {
120
120
  * If the client doesn't support elicitation, it will throw an error.
121
121
  *
122
122
  * */
123
- elicitation<TSchema extends StandardSchema extends undefined ? never : StandardSchema>(schema: TSchema): Promise<StandardSchemaV1.InferOutput<TSchema>>;
123
+ elicitation<TSchema extends StandardSchema extends undefined ? never : StandardSchema>(message: string, schema: TSchema): Promise<StandardSchemaV1.InferOutput<TSchema>>;
124
124
  /**
125
125
  * Request language model sampling from the client
126
126
  * */