Hi everyone.. Is there any way to attach pre/post ...
# questions
l
Hi everyone.. Is there any way to attach pre/post hook functions to mcp tool functions in software-agent-sdk?
👀 1
l
do you mean call an mcp from a pre/post hook?
l
Nope.. mechanism to trigger my code(hook function) for specific mcp tool calls
Few mcp tools I use produce very long responses resulting in following error
Copy code
'INE860A0102Error: Conversation run failed for id=0a8d2164-2b33-5315-ab98-d2305e73ad7c: [Errno 11] write could not complete without blocking

Conversation logs are stored at: history/0a8d21642b335315ab98d2305e73ad7c

To help debug this issue, please file a bug report at:
  <https://github.com/OpenHands/software-agent-sdk/issues/new>
and attach the conversation logs from the directory above.
So I'm trying to workaround it by custom hook functions to modify the tool response
l
Ah, interesting. Maybe another solution would be that we could trim the output of MCP tools?
But I agree that it might be interesting to add custom post-processing
l
Output trimming may introduce hidden consequences, I think... Both agent designer and mcp server may become oblivious about existence of such mechanism.. Then we need an approach to retrieve the trimmed information
l
Feel free to open an issue with detailed requirements in OpenHands/software-agent-sdk!
l
sure..