findToolSchema returns the schema map for a named tool, or nil.
(sess *Session, toolName string)
| 277 | |
| 278 | // findToolSchema returns the schema map for a named tool, or nil. |
| 279 | func findToolSchema(sess *Session, toolName string) map[string]any { |
| 280 | sess.mu.Lock() |
| 281 | defer sess.mu.Unlock() |
| 282 | for _, t := range sess.Tools { |
| 283 | if t.Name == toolName { |
| 284 | return t.Schema |
| 285 | } |
| 286 | } |
| 287 | return nil |
| 288 | } |
| 289 | |
| 290 | // AsInjectionRule converts a PendingAction (ActionToolCall) into a ToolCallInjectionRule |
| 291 | // that can be used with the existing fabrication functions. |
no outgoing calls
no test coverage detected