Skip to main content
Glama
IQAIcom
by IQAIcom

GET_USER_CREATED_WIKIS

Retrieve wikis created by a specific Ethereum address on IQ.wiki, optionally filtered by time frame.

Instructions

Get wikis created by a specific user on IQ.wiki

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Ethereum address of the user
timeFrameSecondsNoOptional time frame in seconds to filter results

Implementation Reference

  • src/index.ts:18-18 (registration)
    Registration of the GET_USER_CREATED_WIKIS tool via server.addTool()
    server.addTool(getUserCreatedWikisTool);
  • Tool definition with name 'GET_USER_CREATED_WIKIS', parameter schema, and execute function that calls the service
    export const getUserCreatedWikisTool = {
    	name: "GET_USER_CREATED_WIKIS",
    	description: "Get wikis created by a specific user on IQ.wiki",
    	parameters: getUserCreatedWikisParams,
    	execute: async (params: GetUserCreatedWikisParams) => {
    		try {
    			const service = new GetUserCreatedWikisService();
    			const wikis = await service.execute(params.id, params.timeFrameSeconds);
    
    			return service.format(wikis);
    		} catch (error) {
    			if (error instanceof Error) {
    				console.log(`Error in GET_USER_CREATED_WIKIS tool: ${error.message}`);
    				return `Error retrieving user created wikis: ${error.message}`;
    			}
    			return "An unknown error occurred while fetching user created wikis";
    		}
    	},
    } as const;
  • Zod schema defining input parameters: id (string) and optional timeFrameSeconds (number)
    const getUserCreatedWikisParams = z.object({
    	id: z.string().min(1).describe("The Ethereum address of the user"),
    	timeFrameSeconds: z
    		.number()
    		.optional()
    		.describe("Optional time frame in seconds to filter results"),
    });
  • Service class with execute() method fetching wikis from GraphQL and format() method producing formatted output
    export class GetUserCreatedWikisService {
    	async execute(id: string, timeFrameSeconds?: number) {
    		try {
    			const response: any = await client.request(USER_CREATED_WIKIS_QUERY, {
    				id,
    			});
    
    			if (!response.userById) {
    				throw new Error("user does not exist");
    			}
    			if (!response.userById.wikisCreated.activity) {
    				throw new Error("user has not created any wikis");
    			}
    
    			let wikis = response.userById.wikisCreated.activity[0].content;
    
    			// Filter by time if timeFrameSeconds is provided
    			if (timeFrameSeconds) {
    				const now = new Date();
    				const timeLimit = new Date(now.getTime() - timeFrameSeconds * 1000);
    
    				// Filter wikis by creation time
    				wikis = wikis.filter((wiki: any) => {
    					if (!wiki.created) return false;
    					const wikiDate = new Date(wiki.created);
    					return wikiDate >= timeLimit;
    				});
    
    				if (wikis.length === 0) {
    					// Convert seconds to a human-readable format for the error message
    					const timeFrameText =
    						timeFrameSeconds >= 86400
    							? `${timeFrameSeconds / 86400} day(s)`
    							: timeFrameSeconds >= 3600
    								? `${timeFrameSeconds / 3600} hour(s)`
    								: `${timeFrameSeconds / 60} minute(s)`;
    
    					throw new Error(
    						`No created wikis found in the last ${timeFrameText}`,
    					);
    				}
    			}
    
    			return wikis;
    		} catch (error: any) {
    			throw new Error(error.message);
    		}
    	}
    
    	format(wikis: any) {
    		return wikis
    			.map((wiki: any) => {
    				const date = new Date(wiki.created);
    				const formattedDate = date.toLocaleString();
    
    				return dedent`
    						📜 Wiki Created
    						- Title: ${wiki.title}
    						- Summary: ${wiki.summary}
    						- Created: ${formattedDate}
    
    						🔗 Source: ${IQ_BASE_URL}/${wiki.id}
    						🔗 Transaction: https://polygonscan.com/tx/${wiki.transactionHash}
    					`;
    			})
    			.join("\n\n");
    	}
  • GraphQL query (USER_CREATED_WIKIS_QUERY) used to fetch user-created wikis from the API
    export const USER_CREATED_WIKIS_QUERY = graphql(`
      query userCreatedWikis($id: String!) {
        userById(id: $id) {
          wikisCreated {
            ... on UserActivity {
              activity {
                content {
                  id
                  ipfs
                  transactionHash
                  title
                  created
                  updated
                  summary
                  categories {
                    id
                    title
                  }
                  tags {
                    id
                  }
                  images {
                    id
                    type
                  }
                  metadata {
                    id
                    value
                  }
                  user {
                    id
                    profile {
                      username
                      avatar
                    }
                  }
                }
              }
            }
          }
        }
      }
    `);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description does not disclose any behavioral traits such as being read-only, potential rate limits, or data freshness. Since annotations are absent, the description should provide more transparency beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. However, it could be slightly more informative without increasing length significantly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of an output schema, the description does not hint at the return format or any limitations. For a read tool, this leaves gaps in the agent's understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (both parameters have descriptions), so the baseline is 3. The description adds no additional meaning beyond the schema, which already documents 'id' as an Ethereum address and 'timeFrameSeconds' as an optional filter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('wikis created by a specific user on IQ.wiki'), distinguishing it from sibling tools like GET_USER_EDITED_WIKIS by specifying 'created'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as GET_USER_EDITED_WIKIS or GET_USER_WIKI_ACTIVITIES. The usage context is only implied by the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IQAIcom/mcp-iqwiki'

If you have feedback or need assistance with the MCP directory API, please join our Discord server