Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import app from "../../finnhub.app.mjs";

export default {
key: "finnhub-get-insider-transactions",
name: "Get Insider Transactions",
description: "Get a list os insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in description.

"Get a list os insider transactions" should be "Get a list of insider transactions".

Apply this diff:

-  description: "Get a list os insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
+  description: "Get a list of insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: "Get a list os insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
description: "Get a list of insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
🤖 Prompt for AI Agents
In
components/finnhub/actions/get-insider-transactions/get-insider-transactions.mjs
around line 6, the description string has a typo ("Get a list os insider
transactions..."); change "os" to "of" so the description reads "Get a list of
insider transactions from a specified time period. [See the
documentation](https://finnhub.io/docs/api/insider-transactions)" and save the
file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good suggestion

version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
symbol: {
propDefinition: [
app,
"symbol",
],
},
from: {
propDefinition: [
app,
"from",
],
},
to: {
propDefinition: [
app,
"to",
],
},
},
async run({ $ }) {
const response = await this.app.getInsiderTransactions({
$,
params: {
symbol: this.symbol,
from: this.from,
to: this.to,
},
});
$.export("$summary", "Successfully retrieved " + response.data.length + " transactions");
return response;
},
};
33 changes: 33 additions & 0 deletions components/finnhub/actions/get-market-news/get-market-news.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import app from "../../finnhub.app.mjs";

export default {
key: "finnhub-get-market-news",
name: "Get Market News",
description: "Get a list of the latest market news. [See the documentation](https://finnhub.io/docs/api/market-news)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
category: {
propDefinition: [
app,
"category",
],
},
},
async run({ $ }) {
const response = await this.app.getMarketNews({
$,
data: {
category: this.category,
},
});
Comment on lines +24 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify parameter passing pattern.

This action uses data property to pass the category parameter, while other actions (get-insider-transactions, get-symbols, get-recommentadion-trends) use params. Ensure this is intentional and matches the Finnhub API requirements for the /news endpoint.

Run this script to check the API documentation pattern:


🏁 Script executed:

#!/bin/bash
# Check how parameters are passed in other action files
echo "=== Checking parameter passing patterns ==="
rg -A5 "await this\.app\." components/finnhub/actions/

Length of output: 2326


I need to verify if this parameter passing difference is intentional by checking how the app methods are implemented.


Also, let me search for the app definition or method signatures:


Additionally, let me check the Finnhub API documentation context:


---

🏁 Script executed:

```shell
#!/bin/bash
# Check how the app methods are defined in the app/actions.mjs or similar
echo "=== Searching for app method implementations ==="
find components/finnhub -name "*.mjs" -type f | head -20 | xargs grep -l "getMarketNews\|getSymbols\|getInsiderTransactions" | grep -v actions

Length of output: 83


🏁 Script executed:

#!/bin/bash
# Look for where these methods are defined
echo "=== Searching for method definitions ==="
rg -n "getMarketNews|getSymbols|getInsiderTransactions" --type mjs -B2 -A10 | grep -E "(^[^-]|function|async|params|data)" | head -50

Length of output: 68


🌐 Web query:

Finnhub API /news endpoint parameters

💡 Result:

Summary — GET /api/v1/news parameters

  • category (optional) — news category value (examples: general, forex, crypto, merger). [1]
  • minId (optional) — integer ID; return only articles with id > minId (default 0). [1]
  • token / api_key (required) — your Finnhub API token for authentication. [2]

Example request:
GET https://finnhub.io/api/v1/news?category=general&minId=0&token=YOUR_API_KEY. [1][2]

Sources: [1] Finnhub API docs / client library reference (market_news: category, minId). [2] Finnhub examples showing /news usage.



---

🏁 Script executed:

```shell
#!/bin/bash
# View the app method implementations
echo "=== Viewing finnhub.app.mjs methods ==="
rg -A15 "getMarketNews|getSymbols|getInsiderTransactions" components/finnhub/finnhub.app.mjs

Length of output: 618



---

🏁 Script executed:

```shell
#!/bin/bash
# Check the _makeRequest method to understand how it handles params vs data
echo "=== Viewing _makeRequest method ==="
rg -A30 "_makeRequest" components/finnhub/finnhub.app.mjs | head -60

Length of output: 957


Change data to params in get-market-news.mjs (lines 24-29).

The /news endpoint requires query parameters, not a request body. The axios library interprets data as request body and params as query string parameters. All other Finnhub API endpoints in this codebase correctly use params, and the Finnhub documentation confirms /news accepts query parameters (category, minId).

    const response = await this.app.getMarketNews({
      $,
      params: {
        category: this.category,
      },
    });
🤖 Prompt for AI Agents
In components/finnhub/actions/get-market-news/get-market-news.mjs around lines
24 to 29, the call to this.app.getMarketNews incorrectly sends query values
under a request body key `data`; change the payload key from `data` to `params`
so axios will serialize those values as query string parameters (e.g., include
category and any other query fields under `params`) and ensure behavior matches
other Finnhub endpoints and the API docs.

$.export("$summary", "Successfully retrieved " + response.length + " market news");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use template literal for summary message.

For consistency with best practices, use a template literal instead of string concatenation.

Apply this diff:

-    $.export("$summary", "Successfully retrieved " + response.length + " market news");
+    $.export("$summary", `Successfully retrieved ${response.length} market news`);

Based on learnings.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$.export("$summary", "Successfully retrieved " + response.length + " market news");
$.export("$summary", `Successfully retrieved ${response.length} market news`);
🤖 Prompt for AI Agents
In components/finnhub/actions/get-market-news/get-market-news.mjs around line
30, the exported summary uses string concatenation ("Successfully retrieved " +
response.length + " market news"); replace this with a template literal to
follow best practices—use backticks and ${response.length} to build the string,
preserving the same wording and spacing.

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import app from "../../finnhub.app.mjs";

export default {
key: "finnhub-get-recommentadion-trends",
name: "Get Recommentadion Trends",
Comment on lines +4 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix typo in action key and name.

"Recommentadion" should be "Recommendation" throughout. This affects the action key (line 4), name (line 5), the method call (line 24), and ideally the filename and directory name.

Apply this diff:

-  key: "finnhub-get-recommentadion-trends",
-  name: "Get Recommentadion Trends",
+  key: "finnhub-get-recommendation-trends",
+  name: "Get Recommendation Trends",

Also update the method call on line 24:

-    const response = await this.app.getRecommentadionTrends({
+    const response = await this.app.getRecommendationTrends({

And rename the directory from get-recommentadion-trends to get-recommendation-trends.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
key: "finnhub-get-recommentadion-trends",
name: "Get Recommentadion Trends",
key: "finnhub-get-recommendation-trends",
name: "Get Recommendation Trends",
🤖 Prompt for AI Agents
In
components/finnhub/actions/get-recommentadion-trends/get-recommentadion-trends.mjs
around lines 4-5 (and also affecting line 24), fix the misspelling
"Recommentadion" to "Recommendation": update the action key to
"finnhub-get-recommendation-trends", update the action name to "Get
Recommendation Trends", and change the method call on line 24 to the corrected
name; then rename the directory and file from get-recommentadion-trends to
get-recommendation-trends (and update any import/path references accordingly).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the typo here

description: "Get latest analyst recommendation trends for a company. [See the documentation](https://finnhub.io/docs/api/recommendation-trends)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
symbol: {
propDefinition: [
app,
"symbol",
],
},
},
async run({ $ }) {
const response = await this.app.getRecommentadionTrends({
$,
params: {
symbol: this.symbol,
},
});
$.export("$summary", "Successfully retrieved " + response.length + " recommendation trends");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use template literal for summary message.

For consistency with best practices, use a template literal instead of string concatenation.

Apply this diff:

-    $.export("$summary", "Successfully retrieved " + response.length + " recommendation trends");
+    $.export("$summary", `Successfully retrieved ${response.length} recommendation trends`);

Based on learnings.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$.export("$summary", "Successfully retrieved " + response.length + " recommendation trends");
$.export("$summary", `Successfully retrieved ${response.length} recommendation trends`);
🤖 Prompt for AI Agents
In
components/finnhub/actions/get-recommentadion-trends/get-recommentadion-trends.mjs
around line 30, the summary message uses string concatenation; replace it with a
template literal to improve consistency and readability — update the $.export
call to use a backtick-delimited template like `Successfully retrieved
${response.length} recommendation trends`.

return response;
},
};
47 changes: 47 additions & 0 deletions components/finnhub/actions/get-symbols/get-symbols.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import app from "../../finnhub.app.mjs";

export default {
key: "finnhub-get-symbols",
name: "Get Symbols",
description: "Get a list of supported stock symbols. [See the documentation](https://finnhub.io/docs/api/stock-symbols)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
exchange: {
propDefinition: [
app,
"exchange",
],
},
currency: {
propDefinition: [
app,
"currency",
],
},
mic: {
propDefinition: [
app,
"mic",
],
},
},
async run({ $ }) {
const response = await this.app.getSymbols({
$,
params: {
exchange: this.exchange,
currency: this.currency,
mic: this.mic,
},
});
$.export("$summary", "Successfully retrieved " + response.length + " symbols");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use template literal for summary message.

For consistency with best practices, use a template literal instead of string concatenation.

Apply this diff:

-    $.export("$summary", "Successfully retrieved " + response.length + " symbols");
+    $.export("$summary", `Successfully retrieved ${response.length} symbols`);

Based on learnings.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$.export("$summary", "Successfully retrieved " + response.length + " symbols");
$.export("$summary", `Successfully retrieved ${response.length} symbols`);
🤖 Prompt for AI Agents
In components/finnhub/actions/get-symbols/get-symbols.mjs around line 44, the
summary uses string concatenation ("Successfully retrieved " + response.length +
" symbols"); replace it with a template literal that interpolates
response.length (e.g., `\`Successfully retrieved ${response.length} symbols\``)
to follow best practices and maintain consistency.

return response;
},
};
Loading
Loading