#Tools fetch limit for Reddit

26 messages · Page 1 of 1 (latest)

warped pawn
#

I used REST API

ruby deltaBOT
#

Hey, can you share a minimal reproducible cURL snippet that we can use the understand the issue? Thanks

warped pawn
#

Sure

warped pawn
#

logConversationConnectionTools: async (conversationId: string, userId: string) => {
try {
const state = get();
const allConversationConnections = state.connections[conversationId] || [];

connections with an actual connected_account_id
  const authenticatedConnections = allConversationConnections.filter((connection) => 
    connection.user_id === userId &&
    connection.is_authenticated === true &&
    !!connection.connected_account_id
  );

  if (authenticatedConnections.length === 0) {
    console.log('[Conversation Connections Store] No authenticated Composio connections to list tools for:', {
      conversationId,
      userId,
    });
    return;
  }

  // Get unique app IDs for which we should fetch tools
  const appIdsSet = new Set<string>();
  authenticatedConnections.forEach((connection) => {
    if (connection.app_id) {
      appIdsSet.add(connection.app_id);
    }
  });

  const appIds = Array.from(appIdsSet);

  if (appIds.length === 0) {
    console.log('[Conversation Connections Store] No appIds found for authenticated connections when listing tools:', {
      conversationId,
      userId,
    });
    return;
  }

  // Use composioService.getTools which uses REST API (/tools) when needed
  const tools = await composioService.getTools(userId, appIds, authenticatedConnections, conversationId, true);
  const toolNames = tools.map((tool) => tool.originalName || tool.name);

  console.log('[Conversation Connections Store] Composio tools for conversation:', {
    conversationId,
    userId,
    appIds,
    toolsCount: tools.length,
    toolNames,
  });
} catch (error: unknown) {
  const errorMessage = error instanceof Error ? error.message : 'Unknown error';
  console.error('[Conversation Connections Store] Error logging Composio tools for conversation:', {
    conversationId,
    userId,
    error: errorMessage,
  });
}

},

#

Result Printed

'[Conversation Connections Store] Composio tools for conversation:', { conversationId: '123',
userId: '123',
appIds: [ 'reddit' ],
toolsCount: 10,
toolNames:
[ 'REDDIT_CREATE_REDDIT_POST',
'REDDIT_DELETE_REDDIT_COMMENT',
'REDDIT_DELETE_REDDIT_POST',
'REDDIT_EDIT_REDDIT_COMMENT_OR_POST',
'REDDIT_GET_USER_FLAIR',
'REDDIT_POST_REDDIT_COMMENT',
'REDDIT_RETRIEVE_POST_COMMENTS',
'REDDIT_RETRIEVE_REDDIT_POST',
'REDDIT_RETRIEVE_SPECIFIC_COMMENT',
'REDDIT_SEARCH_ACROSS_SUBREDDITS' ] }

rocky blaze
#

Hey @warped pawn, could you share more details for this function: composioService.getTools()? are you using api endpoint to retrieve tools?

warped pawn
#

@rocky blaze Here is the code

rocky blaze
#

Thanks for the info.
Looks like your getTools lacks toolkit version which is returning tools list for an older default pinned version. Could you try passing the toolkit version is SDK snippet? Docs for ref: https://docs.composio.dev/docs/toolkit-versioning. Also, you can dangerously skip the version check by pass dangerouslySkipVersionCheck in params which will default to latest version.

Also, looks like you've implemented fallbacks to use API endpoint, you can add the [toolkit_versions=latest](https://docs.composio.dev/rest-api/tools/get-tools#request.query.toolkit_versions) to use the latest version.

Let me know if you need any help.

warped pawn
#

Great. Let me check

warped pawn
#

I'm using composio/client SDK. Is that ok?

rocky blaze
#

@warped pawn, any specific use case or reason for using composio/client instead of composio/core package?

warped pawn
#

Does composio/core support React?

rocky blaze
#

Yes, you should be able to use it.

warped pawn
#

Got it. Let me check

warped pawn
#

Great. All good. All tools are working now

#

dangerouslySkipVersionCheck didn't worked. So used latest

warped pawn
#

@rocky blaze , Is there anyway to get connected account email or username for identifying the account?

Like connected user account name of Reddit, Twitter etc?

rocky blaze
#

@warped pawn, the standard way of checking the authenticate user details is to use the Test Connection button. Alternatively, you can look for tools which fetches user info. For example: REDDIT_GET_REDDIT_USER_ABOUT.

warped pawn
#

Currently using the Tool name.

Let me check Test Connection

#

Thanks man

warped pawn
#

Can you add GOOGLECALENDAR_GET_PROFILE to get the email id of the calendar. It's missing.

rocky blaze
#

Hey @warped pawn, I've added the feature req and team will be working on the same. ETA is around ~1-2 weeks or sooner.

warped pawn
#

Sounds Good

rocky blaze
#

Hey @warped pawn, the requested tool GOOGLECALENDAR_GET_CALENDAR_PROFILE is live!

warped pawn
#

Awesome