bsv-mcp 0.0.15 → 0.0.16
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/README.md +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/tools/index.ts +0 -0
- package/tools/utils/index.ts +14 -1
package/README.md
CHANGED
|
@@ -177,7 +177,7 @@ General-purpose utility functions:
|
|
|
177
177
|
|
|
178
178
|
| Tool Name | Description | Example Output |
|
|
179
179
|
|-----------|-------------|----------------|
|
|
180
|
-
| `utils_convertData` | Converts data between different
|
|
180
|
+
| `utils_convertData` | Converts data between different encoding formats (utf8, hex, base64, binary).<br><br>**Parameters:**<br>- `data` (required): The string to convert<br>- `from` (required): Source encoding format (utf8, hex, base64, or binary)<br>- `to` (required): Target encoding format (utf8, hex, base64, or binary)<br><br>**Examples:**<br>- UTF-8 to hex: `{"data": "hello world", "from": "utf8", "to": "hex"}` → `68656c6c6f20776f726c64`<br>- UTF-8 to base64: `{"data": "Hello World", "from": "utf8", "to": "base64"}` → `SGVsbG8gV29ybGQ=`<br>- base64 to UTF-8: `{"data": "SGVsbG8gV29ybGQ=", "from": "base64", "to": "utf8"}` → `Hello World`<br>- hex to base64: `{"data": "68656c6c6f20776f726c64", "from": "hex", "to": "base64"}` → `aGVsbG8gd29ybGQ=`<br><br>**Notes:**<br>- All parameters are required<br>- The tool returns the converted data as a string<br>- For binary conversion, data is represented as an array of byte values | `"SGVsbG8gV29ybGQ="` (UTF-8 "Hello World" converted to base64) |
|
|
181
181
|
|
|
182
182
|
## Using the Tools with MCP
|
|
183
183
|
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/tools/index.ts
CHANGED
|
File without changes
|
package/tools/utils/index.ts
CHANGED
|
@@ -11,7 +11,20 @@ const encodingSchema = z.enum(["utf8", "hex", "base64", "binary"]);
|
|
|
11
11
|
export function registerUtilsTools(server: McpServer): void {
|
|
12
12
|
server.tool(
|
|
13
13
|
"utils_convertData",
|
|
14
|
-
"Converts data between different encodings (utf8, hex, base64, binary). Useful for transforming data formats when working with blockchain data, encryption, or file processing
|
|
14
|
+
"Converts data between different encodings (utf8, hex, base64, binary). Useful for transforming data formats when working with blockchain data, encryption, or file processing.\n\n" +
|
|
15
|
+
"Parameters:\n" +
|
|
16
|
+
"- data (required): The string to convert\n" +
|
|
17
|
+
"- from (required): Source encoding format (utf8, hex, base64, or binary)\n" +
|
|
18
|
+
"- to (required): Target encoding format (utf8, hex, base64, or binary)\n\n" +
|
|
19
|
+
"Example usage:\n" +
|
|
20
|
+
"- UTF-8 to hex: {\"data\": \"hello world\", \"from\": \"utf8\", \"to\": \"hex\"} → 68656c6c6f20776f726c64\n" +
|
|
21
|
+
"- UTF-8 to base64: {\"data\": \"Hello World\", \"from\": \"utf8\", \"to\": \"base64\"} → SGVsbG8gV29ybGQ=\n" +
|
|
22
|
+
"- base64 to UTF-8: {\"data\": \"SGVsbG8gV29ybGQ=\", \"from\": \"base64\", \"to\": \"utf8\"} → Hello World\n" +
|
|
23
|
+
"- hex to base64: {\"data\": \"68656c6c6f20776f726c64\", \"from\": \"hex\", \"to\": \"base64\"} → aGVsbG8gd29ybGQ=\n\n" +
|
|
24
|
+
"Notes:\n" +
|
|
25
|
+
"- All parameters are required\n" +
|
|
26
|
+
"- The tool returns the converted data as a string\n" +
|
|
27
|
+
"- For binary conversion, data is represented as an array of byte values",
|
|
15
28
|
{
|
|
16
29
|
args: z.object({
|
|
17
30
|
data: z.string().describe("The data string to be converted"),
|