-
Couldn't load subscription status.
- Fork 2
Add Soroban MCP Tool: Invoke Smart Contract Methods #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…th enums and structs in Soroban
…t invocation parameters
…oke_contract_method, outlining inputs, outputs, features, and example usage
…d output messages
| providedNames: string[], | ||
| ): ValidationError[] { | ||
| const errors: ValidationError[] = []; | ||
| const missing = expectedNames.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to something more readable like missing args
| const wasmFiles = stdout | ||
| .trim() | ||
| .split('\n') | ||
| .filter((file) => file.endsWith('.wasm')); | ||
|
|
||
| resolve(wasmFiles); | ||
| }); | ||
| }); | ||
| return wasmFiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return stdout instead of const...
| const messages = [...formattedStdout, ...formattedStderr]; | ||
|
|
||
| return messages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const messages = [...formattedStdout, ...formattedStderr]; | |
| return messages; | |
| return [...formattedStdout, ...formattedStderr]; |
| const messages = [ | ||
| ...formattedStderr, | ||
| ...this.formatContractDeploymentMessage(formattedStdout), | ||
| ]; | ||
|
|
||
| return messages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const messages = [ | |
| ...formattedStderr, | |
| ...this.formatContractDeploymentMessage(formattedStdout), | |
| ]; | |
| return messages; | |
| return [ | |
| ...formattedStderr, | |
| ...this.formatContractDeploymentMessage(formattedStdout), | |
| ]; |
Summary
This pull request introduces a new MCP Tool:
soroban_invoke_contract_method. Also introduce theSorobanValidationServiceto the Stellar MCP server, enabling type-safe validation of Soroban smart contract method invocations.Implementation Details
Features
Method Validation
Type-Safe Validation
Struct Validation
Type Support
u32,u8,String,boolAddress, structs, enumsOption<Type>Error Handling
Validation Error Types
MISSING_STRUCT_FIELDINVALID_PARAM_TYPEError Context
METHOD_PARAMETERSSTRUCT_FIELDSError Details
Test Coverage
Successful Validation Tests
Error Case Tests
Testing
The implementation includes comprehensive test coverage:
Documentation