Skip to content

Commit 6a889a6

Browse files
committed
Make tool server updated generic
1 parent 8b7e2ba commit 6a889a6

File tree

6 files changed

+28
-16
lines changed

6 files changed

+28
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Make generic tool server updates for eca native tools.
6+
57
## 0.8.0
68

79
- Support tool call approval and configuration to manual approval.

docs/protocol.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -769,20 +769,30 @@ Soon
769769

770770
## Configuration
771771

772-
### MCP server updated (⬅️)
772+
### Tool updated (⬅️)
773773

774-
A server notification about a configured MCP server status update.
775-
This is useful for clients present to user the list of configured MCPs,
776-
their status and available tools.
774+
A server notification about a tool status update like a MCP or native tool.
775+
This is useful for clients present to user the list of configured tools/MCPs,
776+
their status and available tools and actions.
777777

778778
_Request:_
779779

780-
* method: `mcp/serverUpdated`
781-
* params: `MCPServerUpdatedParams` defined as follows:
780+
* method: `tool/serverUpdated`
781+
* params: `ToolServerUpdatedParams` defined as follows:
782782

783783
_Response:_
784784

785+
785786
```typescript
787+
type ToolServerUpdatedParams = EcaServerUpdatedParams | MCPServerUpdatedParams;
788+
789+
interface EcaServerUpdatedParams {
790+
/**
791+
* The built-in tools supported by eca.
792+
*/
793+
tools: ServerTool[];
794+
}
795+
786796
interface MCPServerUpdatedParams {
787797
/**
788798
* The server name.
@@ -807,22 +817,22 @@ interface MCPServerUpdatedParams {
807817
/**
808818
* The tools supported by this mcp server if not disabled.
809819
*/
810-
tools?: MCPServerTool[];
820+
tools?: ServerTool[];
811821
}
812822

813-
interface MCPServerTool {
823+
interface ServerTool {
814824
/**
815-
* The MCP server tool name.
825+
* The server tool name.
816826
*/
817827
name: string;
818828

819829
/**
820-
* The MCP server tool description.
830+
* The server tool description.
821831
*/
822832
description: string;
823833

824834
/**
825-
* The MCP server tool parameters.
835+
* The server tool parameters.
826836
*/
827837
parameters: any;
828838
}

src/eca/handlers.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
(future
4949
(f.mcp/initialize-servers-async!
5050
{:on-server-updated (fn [server]
51-
(messenger/mcp-server-updated messenger server))}
51+
(messenger/tool-server-updated messenger server))}
5252
db*
5353
config))
5454
{:models (keys (:models @db*))

src/eca/messenger.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
(defprotocol IMessenger
88
(chat-content-received [this data])
9-
(mcp-server-updated [this params])
9+
(tool-server-updated [this params])
1010
(showMessage [this msg]))

src/eca/server.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
(chat-content-received [_this content]
9191
(lsp.server/discarding-stdout
9292
(lsp.server/send-notification server "chat/contentReceived" content)))
93-
(mcp-server-updated [_this params]
93+
(tool-server-updated [_this params]
9494
(lsp.server/discarding-stdout
95-
(lsp.server/send-notification server "mcp/serverUpdated" params)))
95+
(lsp.server/send-notification server "tool/serverUpdated" params)))
9696
(showMessage [_this msg]
9797
(lsp.server/discarding-stdout
9898
(lsp.server/send-notification server "$/showMessage" msg))))

test/eca/test_helper.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
(defrecord TestMessenger [messages*]
2525
messenger/IMessenger
2626
(chat-content-received [_ data] (swap! messages* update :chat-content-received (fnil conj []) data))
27-
(mcp-server-updated [_ data] (swap! messages* update :mcp-server-update (fnil conj []) data))
27+
(tool-server-updated [_ data] (swap! messages* update :tool-server-update (fnil conj []) data))
2828
(showMessage [_ data] (swap! messages* update :show-message (fnil conj []) data)))
2929

3030
(defn ^:private make-components []

0 commit comments

Comments
 (0)