Skip to content

Commit 835023a

Browse files
committed
fix: all MCP tools now return a string response to increase compatibility
1 parent fdeb836 commit 835023a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/mcp/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::time::Duration;
44
use include_dir::{Dir, include_dir};
55
use rmcp::handler::server::tool::{Parameters, ToolRouter};
66
use rmcp::model::{ServerCapabilities, ServerInfo};
7-
use rmcp::{Json, ServerHandler, schemars, tool, tool_handler, tool_router};
7+
use rmcp::{ServerHandler, schemars, tool, tool_handler, tool_router};
88
use tokio::sync::RwLock;
99

1010
const PLUGINS_DOCS_DIR: Dir = include_dir!("docs/plugins");
@@ -91,9 +91,9 @@ impl Service {
9191
}
9292

9393
#[tool(description = "Get the number of currently available workers.")]
94-
async fn get_available_workers(&self) -> Json<u64> {
94+
async fn get_available_workers(&self) -> String {
9595
let guard = &*self.sessions.read().await;
96-
Json(guard.get_available_workers())
96+
format!("{}", guard.get_available_workers())
9797
}
9898

9999
#[tool(

src/mcp/service_info.prompt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
This server provides an interface to Legba, a multiprotocol credentials bruteforcer / password sprayer and enumerator.
1+
Legba is a credentials bruteforcer, password sprayer and enumerator supporting several protocols with a dedicated plugin each.
22

3-
## Available Plugins
3+
## Supported Protocols Plugin Identifiers
44

55
##PLUGIN_LIST##
66

7-
- Use the plugin_info tool with the plugin identifier, as it is in this list, as it is to get information about a plugin, its options and how to use it.
7+
## Instructions
8+
9+
- Use the `plugin_info` tool with the plugin identifier to get information about a plugin, its options and how to use it.
810
- Some plugin identifiers (like HTTP) actually group multiple plugins, make sure to use the right one by using the examples as a reference.
9-
- Start a new session with the start_session tool.
10-
- Each session you start will use up the amount of workers you specify in --concurrency and free them once concluded.
11-
- Use the get_available_workers tool to determine how many workers are available for use and wait if none is free.
11+
- Start a new session with the `start_session` tool.
12+
- Each session you start will use up the amount of workers you specify in `--concurrency` and free them once concluded.
13+
- Use the `get_available_workers` tool to determine how many workers are available for use and wait if none is free.
1214

1315
## Arguments
1416

0 commit comments

Comments
 (0)