hermoso 0.1.4

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.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +53 -0
  4. data/lib/hermoso/api/account_api.rb +156 -0
  5. data/lib/hermoso/api/analytics_api.rb +400 -0
  6. data/lib/hermoso/api/brands_api.rb +82 -0
  7. data/lib/hermoso/api/campaign_profit_api.rb +103 -0
  8. data/lib/hermoso/api/campaign_results_api.rb +289 -0
  9. data/lib/hermoso/api/channels_api.rb +82 -0
  10. data/lib/hermoso/api/clones_api.rb +93 -0
  11. data/lib/hermoso/api/connect_links_api.rb +228 -0
  12. data/lib/hermoso/api/connect_redirects_api.rb +153 -0
  13. data/lib/hermoso/api/connections_api.rb +151 -0
  14. data/lib/hermoso/api/credits_api.rb +85 -0
  15. data/lib/hermoso/api/edits_api.rb +102 -0
  16. data/lib/hermoso/api/events_api.rb +932 -0
  17. data/lib/hermoso/api/generations_api.rb +173 -0
  18. data/lib/hermoso/api/jobs_api.rb +226 -0
  19. data/lib/hermoso/api/library_api.rb +88 -0
  20. data/lib/hermoso/api/media_api.rb +158 -0
  21. data/lib/hermoso/api/models_api.rb +88 -0
  22. data/lib/hermoso/api/posts_api.rb +377 -0
  23. data/lib/hermoso/api/recasts_api.rb +102 -0
  24. data/lib/hermoso/api/signup_api.rb +164 -0
  25. data/lib/hermoso/api/tag_api.rb +570 -0
  26. data/lib/hermoso/api/tools_api.rb +252 -0
  27. data/lib/hermoso/api_client.rb +441 -0
  28. data/lib/hermoso/api_error.rb +58 -0
  29. data/lib/hermoso/api_model_base.rb +92 -0
  30. data/lib/hermoso/configuration.rb +400 -0
  31. data/lib/hermoso/helpers.rb +116 -0
  32. data/lib/hermoso/models/asset.rb +241 -0
  33. data/lib/hermoso/models/asset_list.rb +203 -0
  34. data/lib/hermoso/models/best_time.rb +250 -0
  35. data/lib/hermoso/models/best_time_slots_inner.rb +205 -0
  36. data/lib/hermoso/models/brand.rb +273 -0
  37. data/lib/hermoso/models/brand_list.rb +203 -0
  38. data/lib/hermoso/models/campaign_profit.rb +261 -0
  39. data/lib/hermoso/models/campaign_results.rb +250 -0
  40. data/lib/hermoso/models/campaign_results_upload.rb +171 -0
  41. data/lib/hermoso/models/campaign_results_upload_rows_inner.rb +259 -0
  42. data/lib/hermoso/models/channel.rb +326 -0
  43. data/lib/hermoso/models/channel_carousel.rb +188 -0
  44. data/lib/hermoso/models/channel_list.rb +203 -0
  45. data/lib/hermoso/models/clone_quote.rb +243 -0
  46. data/lib/hermoso/models/clone_quote_request.rb +227 -0
  47. data/lib/hermoso/models/clone_quote_step.rb +201 -0
  48. data/lib/hermoso/models/connect_link.rb +321 -0
  49. data/lib/hermoso/models/connect_link_account.rb +178 -0
  50. data/lib/hermoso/models/connect_link_create.rb +236 -0
  51. data/lib/hermoso/models/connect_link_error.rb +169 -0
  52. data/lib/hermoso/models/connect_redirects.rb +203 -0
  53. data/lib/hermoso/models/connect_redirects_set.rb +180 -0
  54. data/lib/hermoso/models/connection.rb +250 -0
  55. data/lib/hermoso/models/connection_accounts_inner.rb +178 -0
  56. data/lib/hermoso/models/connection_deleted.rb +228 -0
  57. data/lib/hermoso/models/connection_list.rb +203 -0
  58. data/lib/hermoso/models/contact_email.rb +189 -0
  59. data/lib/hermoso/models/contact_email_resend.rb +161 -0
  60. data/lib/hermoso/models/content_decay.rb +223 -0
  61. data/lib/hermoso/models/content_decay_buckets_inner.rb +187 -0
  62. data/lib/hermoso/models/conversion_destination_create.rb +317 -0
  63. data/lib/hermoso/models/conversion_destination_list.rb +223 -0
  64. data/lib/hermoso/models/conversion_destination_result.rb +221 -0
  65. data/lib/hermoso/models/conversion_event_list.rb +230 -0
  66. data/lib/hermoso/models/conversion_event_update.rb +195 -0
  67. data/lib/hermoso/models/conversion_events_send.rb +236 -0
  68. data/lib/hermoso/models/conversion_events_send_events_inner.rb +314 -0
  69. data/lib/hermoso/models/conversion_insights.rb +265 -0
  70. data/lib/hermoso/models/conversion_send_result.rb +257 -0
  71. data/lib/hermoso/models/conversion_send_result_destinations_inner.rb +286 -0
  72. data/lib/hermoso/models/credits.rb +240 -0
  73. data/lib/hermoso/models/credits_limits.rb +234 -0
  74. data/lib/hermoso/models/credits_limits_brands_inner.rb +218 -0
  75. data/lib/hermoso/models/credits_limits_brands_inner_members_inner.rb +196 -0
  76. data/lib/hermoso/models/deleted.rb +210 -0
  77. data/lib/hermoso/models/edit.rb +278 -0
  78. data/lib/hermoso/models/edit_create.rb +317 -0
  79. data/lib/hermoso/models/edit_preview.rb +199 -0
  80. data/lib/hermoso/models/edit_quote.rb +231 -0
  81. data/lib/hermoso/models/error.rb +198 -0
  82. data/lib/hermoso/models/error_error.rb +335 -0
  83. data/lib/hermoso/models/error_error_unknown_arguments_inner.rb +171 -0
  84. data/lib/hermoso/models/follower_history.rb +239 -0
  85. data/lib/hermoso/models/follower_history_accounts_inner.rb +207 -0
  86. data/lib/hermoso/models/follower_history_accounts_inner_points_inner.rb +178 -0
  87. data/lib/hermoso/models/follower_history_date_range.rb +169 -0
  88. data/lib/hermoso/models/generation_create.rb +435 -0
  89. data/lib/hermoso/models/generation_quote.rb +263 -0
  90. data/lib/hermoso/models/hermoso_tag.rb +230 -0
  91. data/lib/hermoso/models/hermoso_tag_audience_action.rb +325 -0
  92. data/lib/hermoso/models/hermoso_tag_audiences.rb +241 -0
  93. data/lib/hermoso/models/hermoso_tag_events.rb +223 -0
  94. data/lib/hermoso/models/hermoso_tag_events_send.rb +179 -0
  95. data/lib/hermoso/models/hermoso_tag_events_sent.rb +221 -0
  96. data/lib/hermoso/models/hermoso_tag_install.rb +246 -0
  97. data/lib/hermoso/models/hermoso_tag_install_result.rb +255 -0
  98. data/lib/hermoso/models/hermoso_tag_report.rb +261 -0
  99. data/lib/hermoso/models/hermoso_tag_tag.rb +211 -0
  100. data/lib/hermoso/models/hermoso_tag_update.rb +356 -0
  101. data/lib/hermoso/models/inbox_stats.rb +315 -0
  102. data/lib/hermoso/models/job.rb +359 -0
  103. data/lib/hermoso/models/job_cancel.rb +221 -0
  104. data/lib/hermoso/models/job_list.rb +232 -0
  105. data/lib/hermoso/models/media.rb +230 -0
  106. data/lib/hermoso/models/model.rb +327 -0
  107. data/lib/hermoso/models/model_list.rb +203 -0
  108. data/lib/hermoso/models/post.rb +382 -0
  109. data/lib/hermoso/models/post_create.rb +318 -0
  110. data/lib/hermoso/models/post_create_media_inner.rb +104 -0
  111. data/lib/hermoso/models/post_create_media_inner_one_of.rb +201 -0
  112. data/lib/hermoso/models/post_list.rb +221 -0
  113. data/lib/hermoso/models/post_media_inner.rb +169 -0
  114. data/lib/hermoso/models/post_results_inner.rb +205 -0
  115. data/lib/hermoso/models/post_results_inner_first_comment.rb +188 -0
  116. data/lib/hermoso/models/posting_frequency.rb +241 -0
  117. data/lib/hermoso/models/posting_frequency_frequency_inner.rb +205 -0
  118. data/lib/hermoso/models/profit_settings.rb +230 -0
  119. data/lib/hermoso/models/recast.rb +308 -0
  120. data/lib/hermoso/models/recast_create.rb +274 -0
  121. data/lib/hermoso/models/recast_person.rb +182 -0
  122. data/lib/hermoso/models/recast_quote.rb +232 -0
  123. data/lib/hermoso/models/recast_step.rb +201 -0
  124. data/lib/hermoso/models/recast_subject.rb +170 -0
  125. data/lib/hermoso/models/recast_voice.rb +178 -0
  126. data/lib/hermoso/models/recast_window.rb +179 -0
  127. data/lib/hermoso/models/signup.rb +329 -0
  128. data/lib/hermoso/models/signup_claim.rb +178 -0
  129. data/lib/hermoso/models/signup_create.rb +247 -0
  130. data/lib/hermoso/models/tool.rb +360 -0
  131. data/lib/hermoso/models/tool_invoke.rb +169 -0
  132. data/lib/hermoso/models/tool_job.rb +262 -0
  133. data/lib/hermoso/models/tool_list.rb +273 -0
  134. data/lib/hermoso/models/tool_list_areas_inner.rb +219 -0
  135. data/lib/hermoso/models/tool_list_search.rb +181 -0
  136. data/lib/hermoso/models/tool_result.rb +245 -0
  137. data/lib/hermoso/models/tool_result_images_inner.rb +170 -0
  138. data/lib/hermoso/models/warning.rb +244 -0
  139. data/lib/hermoso/spec.rb +8 -0
  140. data/lib/hermoso/version.rb +15 -0
  141. data/lib/hermoso.rb +174 -0
  142. metadata +237 -0
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Hermoso API
3
+
4
+ #The Hermoso public API. Guide: https://hermoso.ai/docs/api/ · OpenAPI: https://app.hermoso.ai/openapi.json
5
+
6
+ The version of the OpenAPI document: 2026-08-26
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.27.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Hermoso
16
+ class ToolsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Call a tool
23
+ # Invoke a tool with a JSON body of its arguments and get its result. The body IS the argument object — there is no envelope to wrap it in. UNKNOWN ARGUMENTS are never silently dropped. A key the tool does not declare that looks like a misspelling or synonym of one it does (`pagId`, `platform` for `target`) is refused with `400 invalid_arguments`, and `error.unknown_arguments` lists each one as `{name, did_you_mean}`, the suggestion always being an argument of THIS tool. Any other undeclared key runs the call without it: the result text starts with a line naming it, and the response carries `ignored_arguments: [{name, did_you_mean}]` (the same list is `data.ignoredArguments`). Keys starting with `_` are host metadata and are never named. The same handler the MCP server and the CLI run, on the same credential, through the same spend gate: a tool that costs credits costs the same credits here, and one that publishes publishes to the same connected account. Send an `Idempotency-Key` on anything that spends or publishes and a retry is safe. The reply carries BOTH halves of the tool's answer: `text` is the sentence (what an agent reads) and `data` is the structured result (what an integration reads). A tool that refuses answers with an HTTP error in the standard envelope, never a 200 with a failure inside it. CONTRACT TIER: the envelope here — the route, the auth, the errors, the rate-limit headers, the idempotency semantics — is stable. A tool's own arguments are not frozen: they improve with the tool. Read `GET /v1/tools/{name}` rather than pinning a schema.
24
+ # @param name [String]
25
+ # @param request_body [Hash<String, Object>]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :callback_url The same as the &#x60;X-Hermoso-Callback-Url&#x60; header, for a client that cannot set headers. Prefer the header: a callback URL is a secret, and query strings are logged. A callback implies &#x60;wait&#x3D;0&#x60; unless you send &#x60;wait&#x60; yourself.
28
+ # @option opts [String] :wait How long to hold this request while a render finishes. Only tools that render through the job queue are affected: video, avatars, template ads, post-production, and image generation (&#x60;generate_image&#x60; is queued as an image job whenever &#x60;wait&#x60; is sent, including &#x60;wait&#x3D;0&#x60;). Every other tool answers as it always does. OMIT IT and nothing changes: a render is held for up to 45 seconds and then answered 200 with &#x60;data.stillRendering: true&#x60; and a &#x60;data.jobId&#x60;. &#x60;wait&#x3D;0&#x60; (or &#x60;false&#x60;) answers 202 with a job handle the moment the job is queued, which is what a platform with a 30-second step limit wants. &#x60;wait&#x3D;&lt;seconds&gt;&#x60; holds at most that long, capped at 45, and answers 202 if the render is not finished by then. Not waiting never changes what a render costs or whether it runs: the job is queued, checked against your balance and billed exactly as it is when you wait. Poll &#x60;GET /v1/jobs/{id}&#x60;.
29
+ # @option opts [String] :x_hermoso_callback_url An https:// URL to POST the outcome to, for a platform that cannot poll (for example Zapier &#x60;z.generateCallbackUrl()&#x60;). When the call queued a job, Hermoso POSTs the job resource — exactly what &#x60;GET /v1/jobs/{id}&#x60; answers — once the job is &#x60;done&#x60; or &#x60;error&#x60;, with headers &#x60;Hermoso-Event: job.done | job.error&#x60; and &#x60;Hermoso-Delivery&#x60; (also sent as &#x60;Idempotency-Key&#x60;; drop a repeat). A 2xx ends delivery; a 4xx other than 408, 425 and 429 is final; anything else is retried for about 16 hours. When the call finished inside the request, its response body is POSTed too (&#x60;Hermoso-Event: tool.result&#x60;). The response header &#x60;Hermoso-Callback&#x60; says what happened: &#x60;registered&#x60;, &#x60;sent&#x60;, &#x60;limit-reached&#x60; or &#x60;not-registered&#x60;. Nothing about what runs or what it costs changes: the URL is attached after the job is queued. A refusal is the HTTP error and nothing is POSTed. Must be https on a public host name; a replay with the same &#x60;Idempotency-Key&#x60; and a new URL adds that URL to the same job.
30
+ # @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with &#x60;Idempotency-Replayed: true&#x60;, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what &#x60;GET /v1/jobs/{id}&#x60; answers), so a finished render replays as done with its file.
31
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
32
+ # @return [ToolResult]
33
+ def call_tool(name, request_body, opts = {})
34
+ data, _status_code, _headers = call_tool_with_http_info(name, request_body, opts)
35
+ data
36
+ end
37
+
38
+ # Call a tool
39
+ # Invoke a tool with a JSON body of its arguments and get its result. The body IS the argument object — there is no envelope to wrap it in. UNKNOWN ARGUMENTS are never silently dropped. A key the tool does not declare that looks like a misspelling or synonym of one it does (&#x60;pagId&#x60;, &#x60;platform&#x60; for &#x60;target&#x60;) is refused with &#x60;400 invalid_arguments&#x60;, and &#x60;error.unknown_arguments&#x60; lists each one as &#x60;{name, did_you_mean}&#x60;, the suggestion always being an argument of THIS tool. Any other undeclared key runs the call without it: the result text starts with a line naming it, and the response carries &#x60;ignored_arguments: [{name, did_you_mean}]&#x60; (the same list is &#x60;data.ignoredArguments&#x60;). Keys starting with &#x60;_&#x60; are host metadata and are never named. The same handler the MCP server and the CLI run, on the same credential, through the same spend gate: a tool that costs credits costs the same credits here, and one that publishes publishes to the same connected account. Send an &#x60;Idempotency-Key&#x60; on anything that spends or publishes and a retry is safe. The reply carries BOTH halves of the tool&#39;s answer: &#x60;text&#x60; is the sentence (what an agent reads) and &#x60;data&#x60; is the structured result (what an integration reads). A tool that refuses answers with an HTTP error in the standard envelope, never a 200 with a failure inside it. CONTRACT TIER: the envelope here — the route, the auth, the errors, the rate-limit headers, the idempotency semantics — is stable. A tool&#39;s own arguments are not frozen: they improve with the tool. Read &#x60;GET /v1/tools/{name}&#x60; rather than pinning a schema.
40
+ # @param name [String]
41
+ # @param request_body [Hash<String, Object>]
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :callback_url The same as the &#x60;X-Hermoso-Callback-Url&#x60; header, for a client that cannot set headers. Prefer the header: a callback URL is a secret, and query strings are logged. A callback implies &#x60;wait&#x3D;0&#x60; unless you send &#x60;wait&#x60; yourself.
44
+ # @option opts [String] :wait How long to hold this request while a render finishes. Only tools that render through the job queue are affected: video, avatars, template ads, post-production, and image generation (&#x60;generate_image&#x60; is queued as an image job whenever &#x60;wait&#x60; is sent, including &#x60;wait&#x3D;0&#x60;). Every other tool answers as it always does. OMIT IT and nothing changes: a render is held for up to 45 seconds and then answered 200 with &#x60;data.stillRendering: true&#x60; and a &#x60;data.jobId&#x60;. &#x60;wait&#x3D;0&#x60; (or &#x60;false&#x60;) answers 202 with a job handle the moment the job is queued, which is what a platform with a 30-second step limit wants. &#x60;wait&#x3D;&lt;seconds&gt;&#x60; holds at most that long, capped at 45, and answers 202 if the render is not finished by then. Not waiting never changes what a render costs or whether it runs: the job is queued, checked against your balance and billed exactly as it is when you wait. Poll &#x60;GET /v1/jobs/{id}&#x60;.
45
+ # @option opts [String] :x_hermoso_callback_url An https:// URL to POST the outcome to, for a platform that cannot poll (for example Zapier &#x60;z.generateCallbackUrl()&#x60;). When the call queued a job, Hermoso POSTs the job resource — exactly what &#x60;GET /v1/jobs/{id}&#x60; answers — once the job is &#x60;done&#x60; or &#x60;error&#x60;, with headers &#x60;Hermoso-Event: job.done | job.error&#x60; and &#x60;Hermoso-Delivery&#x60; (also sent as &#x60;Idempotency-Key&#x60;; drop a repeat). A 2xx ends delivery; a 4xx other than 408, 425 and 429 is final; anything else is retried for about 16 hours. When the call finished inside the request, its response body is POSTed too (&#x60;Hermoso-Event: tool.result&#x60;). The response header &#x60;Hermoso-Callback&#x60; says what happened: &#x60;registered&#x60;, &#x60;sent&#x60;, &#x60;limit-reached&#x60; or &#x60;not-registered&#x60;. Nothing about what runs or what it costs changes: the URL is attached after the job is queued. A refusal is the HTTP error and nothing is POSTed. Must be https on a public host name; a replay with the same &#x60;Idempotency-Key&#x60; and a new URL adds that URL to the same job.
46
+ # @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with &#x60;Idempotency-Replayed: true&#x60;, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what &#x60;GET /v1/jobs/{id}&#x60; answers), so a finished render replays as done with its file.
47
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
48
+ # @return [Array<(ToolResult, Integer, Hash)>] ToolResult data, response status code and response headers
49
+ def call_tool_with_http_info(name, request_body, opts = {})
50
+ if @api_client.config.debugging
51
+ @api_client.config.logger.debug 'Calling API: ToolsApi.call_tool ...'
52
+ end
53
+ # verify the required parameter 'name' is set
54
+ if @api_client.config.client_side_validation && name.nil?
55
+ fail ArgumentError, "Missing the required parameter 'name' when calling ToolsApi.call_tool"
56
+ end
57
+ # verify the required parameter 'request_body' is set
58
+ if @api_client.config.client_side_validation && request_body.nil?
59
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling ToolsApi.call_tool"
60
+ end
61
+ # resource path
62
+ local_var_path = '/v1/tools/{name}'.sub('{name}', CGI.escape(name.to_s))
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+ query_params[:'callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
67
+ query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
+ # HTTP header 'Content-Type'
74
+ content_type = @api_client.select_header_content_type(['application/json'])
75
+ if !content_type.nil?
76
+ header_params['Content-Type'] = content_type
77
+ end
78
+ header_params[:'X-Hermoso-Callback-Url'] = opts[:'x_hermoso_callback_url'] if !opts[:'x_hermoso_callback_url'].nil?
79
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
80
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
81
+
82
+ # form parameters
83
+ form_params = opts[:form_params] || {}
84
+
85
+ # http body (model)
86
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
87
+
88
+ # return_type
89
+ return_type = opts[:debug_return_type] || 'ToolResult'
90
+
91
+ # auth_names
92
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
93
+
94
+ new_options = opts.merge(
95
+ :operation => :"ToolsApi.call_tool",
96
+ :header_params => header_params,
97
+ :query_params => query_params,
98
+ :form_params => form_params,
99
+ :body => post_body,
100
+ :auth_names => auth_names,
101
+ :return_type => return_type
102
+ )
103
+
104
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug "API called: ToolsApi#call_tool\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
107
+ end
108
+ return data, status_code, headers
109
+ end
110
+
111
+ # Retrieve one tool
112
+ # One tool: what it does, what one call costs (`price`), which area it belongs to, whether it is read-only, which connector it needs, and the JSON Schema for its arguments. A tool withheld from the index because its connector is not linked is still described HERE, with `connector_connected: false` — so \"what would I have to link to use this?\" is answerable without linking anything first.
113
+ # @param name [String]
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
116
+ # @return [Tool]
117
+ def get_tool(name, opts = {})
118
+ data, _status_code, _headers = get_tool_with_http_info(name, opts)
119
+ data
120
+ end
121
+
122
+ # Retrieve one tool
123
+ # One tool: what it does, what one call costs (&#x60;price&#x60;), which area it belongs to, whether it is read-only, which connector it needs, and the JSON Schema for its arguments. A tool withheld from the index because its connector is not linked is still described HERE, with &#x60;connector_connected: false&#x60; — so \&quot;what would I have to link to use this?\&quot; is answerable without linking anything first.
124
+ # @param name [String]
125
+ # @param [Hash] opts the optional parameters
126
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
127
+ # @return [Array<(Tool, Integer, Hash)>] Tool data, response status code and response headers
128
+ def get_tool_with_http_info(name, opts = {})
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: ToolsApi.get_tool ...'
131
+ end
132
+ # verify the required parameter 'name' is set
133
+ if @api_client.config.client_side_validation && name.nil?
134
+ fail ArgumentError, "Missing the required parameter 'name' when calling ToolsApi.get_tool"
135
+ end
136
+ # resource path
137
+ local_var_path = '/v1/tools/{name}'.sub('{name}', CGI.escape(name.to_s))
138
+
139
+ # query parameters
140
+ query_params = opts[:query_params] || {}
141
+
142
+ # header parameters
143
+ header_params = opts[:header_params] || {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
146
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
147
+
148
+ # form parameters
149
+ form_params = opts[:form_params] || {}
150
+
151
+ # http body (model)
152
+ post_body = opts[:debug_body]
153
+
154
+ # return_type
155
+ return_type = opts[:debug_return_type] || 'Tool'
156
+
157
+ # auth_names
158
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
159
+
160
+ new_options = opts.merge(
161
+ :operation => :"ToolsApi.get_tool",
162
+ :header_params => header_params,
163
+ :query_params => query_params,
164
+ :form_params => form_params,
165
+ :body => post_body,
166
+ :auth_names => auth_names,
167
+ :return_type => return_type
168
+ )
169
+
170
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug "API called: ToolsApi#get_tool\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173
+ end
174
+ return data, status_code, headers
175
+ end
176
+
177
+ # List the callable tools
178
+ # Everything this workspace can do over HTTP, grouped by area, each with its human-readable description, its JSON Schema and its `price` (what one call spends, read live). This is the browsable index: filter by `area`, search by task words (`search=email outreach`, ranked the way the MCP `find_tools` tool ranks), page with a cursor. READ IT, DO NOT HARD-CODE IT. The set grows continuously and a tool absent here is not a missing capability. By default a tool whose connector this workspace has not linked is left out, because it could only ever answer \"not connected\". Send `include=all` to list EVERY tool, including those: each such row has `available: false`, `unavailable_reason` (`not_connected`, `not_offered` or `shopify_store`), `requires_connector` and a `connect_url` to link it. That is how you build for customers whose accounts are connected to platforms your own test account is not. Calling one of them answers `401` with `error.type: connector_error` and `error.connector`. CONTRACT TIER: this endpoint's SHAPE is stable under the same promise as everything else in `/v1`. The TOOLS inside it are not frozen — their arguments improve as the tools do. Treat the roster as live data.
179
+ # @param [Hash] opts the optional parameters
180
+ # @option opts [String] :area Filter to one area. &#x60;areas[]&#x60; in the response lists them with a description and a count.
181
+ # @option opts [String] :search Words from the task or the tool name, e.g. &#x60;email outreach&#x60;, &#x60;schedule post&#x60;, &#x60;google ads keyword&#x60;. Each word is matched on its own (with plurals, common synonyms and one-letter typos), and the rows come back RANKED, best first: the same ranking the MCP &#x60;find_tools&#x60; tool uses. &#x60;search.strong_matches&#x60; in the response says how many rows match strongly; the rest are looser matches, ranked below.
182
+ # @option opts [String] :include &#x60;all&#x60; lists every tool, including the ones that need a connector this workspace has not linked (&#x60;available: false&#x60;, with &#x60;connect_url&#x60;). Omit it for only the tools this workspace can call now. Tools that are not released to anyone are never listed.
183
+ # @option opts [Integer] :limit 1-200, default 25. Each row carries a JSON Schema, so a large page is a large response.
184
+ # @option opts [String] :starting_after A tool name from a previous page; returns the page after it. An unknown cursor is an error, never a silent restart.
185
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
186
+ # @return [ToolList]
187
+ def list_tools(opts = {})
188
+ data, _status_code, _headers = list_tools_with_http_info(opts)
189
+ data
190
+ end
191
+
192
+ # List the callable tools
193
+ # Everything this workspace can do over HTTP, grouped by area, each with its human-readable description, its JSON Schema and its &#x60;price&#x60; (what one call spends, read live). This is the browsable index: filter by &#x60;area&#x60;, search by task words (&#x60;search&#x3D;email outreach&#x60;, ranked the way the MCP &#x60;find_tools&#x60; tool ranks), page with a cursor. READ IT, DO NOT HARD-CODE IT. The set grows continuously and a tool absent here is not a missing capability. By default a tool whose connector this workspace has not linked is left out, because it could only ever answer \&quot;not connected\&quot;. Send &#x60;include&#x3D;all&#x60; to list EVERY tool, including those: each such row has &#x60;available: false&#x60;, &#x60;unavailable_reason&#x60; (&#x60;not_connected&#x60;, &#x60;not_offered&#x60; or &#x60;shopify_store&#x60;), &#x60;requires_connector&#x60; and a &#x60;connect_url&#x60; to link it. That is how you build for customers whose accounts are connected to platforms your own test account is not. Calling one of them answers &#x60;401&#x60; with &#x60;error.type: connector_error&#x60; and &#x60;error.connector&#x60;. CONTRACT TIER: this endpoint&#39;s SHAPE is stable under the same promise as everything else in &#x60;/v1&#x60;. The TOOLS inside it are not frozen — their arguments improve as the tools do. Treat the roster as live data.
194
+ # @param [Hash] opts the optional parameters
195
+ # @option opts [String] :area Filter to one area. &#x60;areas[]&#x60; in the response lists them with a description and a count.
196
+ # @option opts [String] :search Words from the task or the tool name, e.g. &#x60;email outreach&#x60;, &#x60;schedule post&#x60;, &#x60;google ads keyword&#x60;. Each word is matched on its own (with plurals, common synonyms and one-letter typos), and the rows come back RANKED, best first: the same ranking the MCP &#x60;find_tools&#x60; tool uses. &#x60;search.strong_matches&#x60; in the response says how many rows match strongly; the rest are looser matches, ranked below.
197
+ # @option opts [String] :include &#x60;all&#x60; lists every tool, including the ones that need a connector this workspace has not linked (&#x60;available: false&#x60;, with &#x60;connect_url&#x60;). Omit it for only the tools this workspace can call now. Tools that are not released to anyone are never listed.
198
+ # @option opts [Integer] :limit 1-200, default 25. Each row carries a JSON Schema, so a large page is a large response.
199
+ # @option opts [String] :starting_after A tool name from a previous page; returns the page after it. An unknown cursor is an error, never a silent restart.
200
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
201
+ # @return [Array<(ToolList, Integer, Hash)>] ToolList data, response status code and response headers
202
+ def list_tools_with_http_info(opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: ToolsApi.list_tools ...'
205
+ end
206
+ # resource path
207
+ local_var_path = '/v1/tools'
208
+
209
+ # query parameters
210
+ query_params = opts[:query_params] || {}
211
+ query_params[:'area'] = opts[:'area'] if !opts[:'area'].nil?
212
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
213
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
214
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
215
+ query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil?
216
+
217
+ # header parameters
218
+ header_params = opts[:header_params] || {}
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
221
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
222
+
223
+ # form parameters
224
+ form_params = opts[:form_params] || {}
225
+
226
+ # http body (model)
227
+ post_body = opts[:debug_body]
228
+
229
+ # return_type
230
+ return_type = opts[:debug_return_type] || 'ToolList'
231
+
232
+ # auth_names
233
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
234
+
235
+ new_options = opts.merge(
236
+ :operation => :"ToolsApi.list_tools",
237
+ :header_params => header_params,
238
+ :query_params => query_params,
239
+ :form_params => form_params,
240
+ :body => post_body,
241
+ :auth_names => auth_names,
242
+ :return_type => return_type
243
+ )
244
+
245
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: ToolsApi#list_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ return data, status_code, headers
250
+ end
251
+ end
252
+ end