Device info endpoint + richer node summaries (GET /api/device, MCP device_info) (#13)
CI / build + unit (push) Successful in 36s
CI / build + unit (push) Successful in 36s
This commit was merged in pull request #13.
This commit is contained in:
@@ -64,13 +64,14 @@ async function connectMcp(svc: MeshService): Promise<{
|
||||
}
|
||||
|
||||
describe('MCP server tools', () => {
|
||||
it('lists all six tools with descriptions and input schemas', async () => {
|
||||
it('lists all seven tools with descriptions and input schemas', async () => {
|
||||
const env = await connectedService();
|
||||
try {
|
||||
const mcp = await connectMcp(env.svc);
|
||||
try {
|
||||
const { tools } = await mcp.client.listTools();
|
||||
expect(tools.map((t) => t.name).sort()).toEqual([
|
||||
'device_info',
|
||||
'get_messages',
|
||||
'get_node',
|
||||
'list_channels',
|
||||
@@ -215,7 +216,7 @@ describe('MCP server tools', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('list_channels, list_nodes and get_messages return the service data', async () => {
|
||||
it('list_channels, list_nodes, get_messages and device_info return the service data', async () => {
|
||||
const env = await connectedService();
|
||||
try {
|
||||
env.sockets[0].write(nodeInfoFrame(KAMIL_NUM, kamilNodeInfo()));
|
||||
@@ -234,6 +235,15 @@ describe('MCP server tools', () => {
|
||||
),
|
||||
).toEqual([]); // no channel frames fed yet
|
||||
|
||||
// no metadata/config frames fed yet → empty sections, null node num
|
||||
expect(
|
||||
JSON.parse(
|
||||
toolText(
|
||||
await mcp.client.callTool({ name: 'device_info', arguments: {} }),
|
||||
),
|
||||
),
|
||||
).toEqual({ myNodeNum: null, localConfig: {}, moduleConfig: {} });
|
||||
|
||||
const nodes = JSON.parse(
|
||||
toolText(
|
||||
await mcp.client.callTool({ name: 'list_nodes', arguments: {} }),
|
||||
|
||||
Reference in New Issue
Block a user